Fixed audio delay
This commit is contained in:
parent
235ac9054f
commit
8664e97f5f
File diff suppressed because it is too large
Load Diff
|
@ -4568,11 +4568,6 @@ public class GL11 implements JSObject {
|
||||||
private static int playbackId = 0;
|
private static int playbackId = 0;
|
||||||
private static final HashMap<String,AudioBufferX> loadedSoundFiles = new HashMap();
|
private static final HashMap<String,AudioBufferX> loadedSoundFiles = new HashMap();
|
||||||
private static AudioContext audioctx = null;
|
private static AudioContext audioctx = null;
|
||||||
private static float playbackOffsetDelay = 0.03f;
|
|
||||||
|
|
||||||
public static final void setPlaybackOffsetDelay(float f) {
|
|
||||||
playbackOffsetDelay = f;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
public static native AudioBuffer decodeAudioAsync(ArrayBuffer buffer);
|
public static native AudioBuffer decodeAudioAsync(ArrayBuffer buffer);
|
||||||
|
@ -4644,7 +4639,7 @@ public class GL11 implements JSObject {
|
||||||
s.connect(g);
|
s.connect(g);
|
||||||
g.connect(p);
|
g.connect(p);
|
||||||
p.connect(audioctx.getDestination());
|
p.connect(audioctx.getDestination());
|
||||||
s.start(0.0d, playbackOffsetDelay);
|
s.start(0.0d);
|
||||||
final int theId = ++playbackId;
|
final int theId = ++playbackId;
|
||||||
activeSoundEffects.put(theId, new AudioBufferSourceNodeX(s, p, g));
|
activeSoundEffects.put(theId, new AudioBufferSourceNodeX(s, p, g));
|
||||||
s.setOnEnded(new EventListener<MediaEvent>() {
|
s.setOnEnded(new EventListener<MediaEvent>() {
|
||||||
|
@ -4667,7 +4662,7 @@ public class GL11 implements JSObject {
|
||||||
g.getGain().setValue(volume > 1.0f ? 1.0f : volume);
|
g.getGain().setValue(volume > 1.0f ? 1.0f : volume);
|
||||||
s.connect(g);
|
s.connect(g);
|
||||||
g.connect(audioctx.getDestination());
|
g.connect(audioctx.getDestination());
|
||||||
s.start(0.0d, playbackOffsetDelay);
|
s.start(0.0d);
|
||||||
final int theId = ++playbackId;
|
final int theId = ++playbackId;
|
||||||
activeSoundEffects.put(theId, new AudioBufferSourceNodeX(s, null, g));
|
activeSoundEffects.put(theId, new AudioBufferSourceNodeX(s, null, g));
|
||||||
s.setOnEnded(new EventListener<MediaEvent>() {
|
s.setOnEnded(new EventListener<MediaEvent>() {
|
||||||
|
|
15776
web/js/app.js
15776
web/js/app.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user