If we want to use fancier SPI things (such as the stuff to trivially let us
play oggs), we need to jump through slightly more hoops with our audio. Also, bumping up LINEBUF_SIZE appears to clear up some general issues with linux playback being worse than other platforms, but definitely solves issues where playing ogg turned into a bowl of rice krispies on all platforms. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@308 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -507,6 +507,16 @@ public class SoundManager
|
||||
|
||||
// open the sound line
|
||||
AudioFormat format = stream.getFormat();
|
||||
stream = AudioSystem.getAudioInputStream(
|
||||
new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
|
||||
format.getSampleRate(),
|
||||
16,
|
||||
format.getChannels(),
|
||||
format.getChannels() * 2,
|
||||
format.getSampleRate(),
|
||||
false), stream);
|
||||
format = stream.getFormat();
|
||||
|
||||
line = (SourceDataLine) AudioSystem.getLine(
|
||||
new DataLine.Info(SourceDataLine.class, format));
|
||||
line.open(format, LINEBUF_SIZE);
|
||||
@@ -1007,7 +1017,7 @@ public class SoundManager
|
||||
protected static final long MAX_SOUND_DELAY = 400L;
|
||||
|
||||
/** The size of the line's buffer. */
|
||||
protected static final int LINEBUF_SIZE = 8 * 1024;
|
||||
protected static final int LINEBUF_SIZE = 32 * 1024;
|
||||
|
||||
/** The maximum time a spooler will wait for a stream before deciding to shut down. */
|
||||
protected static final long MAX_WAIT_TIME = 30000L;
|
||||
|
||||
Reference in New Issue
Block a user