Call mark() on the audio input stream because that creates some sort of
push-back buffer that prevents sounds from blarching when we reset the stream. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3422 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -450,9 +450,12 @@ public class SoundManager
|
|||||||
|
|
||||||
AudioInputStream stream = AudioSystem.getAudioInputStream(
|
AudioInputStream stream = AudioSystem.getAudioInputStream(
|
||||||
new ByteArrayInputStream(data));
|
new ByteArrayInputStream(data));
|
||||||
AudioFormat format = stream.getFormat();
|
if (key.cmd == LOOP) {
|
||||||
|
stream.mark(data.length);
|
||||||
|
}
|
||||||
|
|
||||||
// open the sound line
|
// open the sound line
|
||||||
|
AudioFormat format = stream.getFormat();
|
||||||
line = (SourceDataLine) AudioSystem.getLine(
|
line = (SourceDataLine) AudioSystem.getLine(
|
||||||
new DataLine.Info(SourceDataLine.class, format));
|
new DataLine.Info(SourceDataLine.class, format));
|
||||||
line.open(format, LINEBUF_SIZE);
|
line.open(format, LINEBUF_SIZE);
|
||||||
|
|||||||
Reference in New Issue
Block a user