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:
Michael Bayne
2005-03-23 20:57:38 +00:00
parent 4bfbb96dfe
commit 1da2e7cc0e
@@ -450,9 +450,12 @@ public class SoundManager
AudioInputStream stream = AudioSystem.getAudioInputStream(
new ByteArrayInputStream(data));
AudioFormat format = stream.getFormat();
if (key.cmd == LOOP) {
stream.mark(data.length);
}
// open the sound line
AudioFormat format = stream.getFormat();
line = (SourceDataLine) AudioSystem.getLine(
new DataLine.Info(SourceDataLine.class, format));
line.open(format, LINEBUF_SIZE);