Changing volume in Java when using JLayer.
Posted
by Penchant
on Stack Overflow
See other posts from Stack Overflow
or by Penchant
Published on 2009-03-15T16:43:55Z
Indexed on
2010/06/11
8:03 UTC
Read the original article
Hit count: 415
I'm using JLayer to play an inputstream of mp3 data from the internet. How do i change the volume of the output?
I'm using this code to play it:
URL u = new URL(s);
URLConnection conn = u.openConnection();
conn.setConnectTimeout(Searcher.timeoutms);
conn.setReadTimeout(Searcher.timeoutms);
bitstream = new Bitstream(conn.getInputStream()/*new FileInputStream(quick_file)*/);
System.out.println(bitstream);
decoder = new Decoder();
decoder.setEqualizer(equalizer);
audio = FactoryRegistry.systemRegistry().createAudioDevice();
audio.open(decoder);
for(int i = quick_positions[0]; i > 0; i--){
Header h = bitstream.readFrame();
if (h == null){
return;
}
bitstream.closeFrame();
© Stack Overflow or respective owner