jlayer:mp3解码库
http://www.javazoom.net/javalayer/javalayer.html
思路:通过http得到在线音频文件的输入流,将未解码的音频流使用jlayer进行解码操作,保存解码后的音频数据到队列中,通过另一线程读取解码后的音频数据,从而边下边播的功能
/**
* 解码操作
*/
private class DecodeThread extends Thread {
private InputStream inputStream = null;
private URL url = null;
private int sampleRate;
private int channel;
public DecodeThread(URL url, int sampleRate, int channel) {
this.url = url;
this.sampleRate = sampleRate;
this.channel = channel;
}