我正在开发一个 android 应用程序,它可以播放实时 speex 音频流。所以我使用了 jspeex库。
音频流为 11khz,16 位。
在android方面我做了如下:
SpeexDecoder decoder = new SpeexDecoder();
decoder.init(1, 11025,1, true);
decoder.processData(subdata, 0, subdata.length);
byte[] decoded_data = new byte[decoder.getProcessedDataByteSize()];
int result= decoder.getProcessedData(decoded_data, 0);
当 Audiotrack 播放此解码数据时,会剪辑音频的某些部分。
此外,当解码器设置为 nb-mode(第一个参数设置为 0)时,音质更差。我想知道我的代码中有任何参数配置错误。
任何帮助,建议表示赞赏。
提前致谢。