本文主要是介绍调试|Android平台的声音播放|AudioTrack|JNI|悲催的侧边键,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.AudioTrack的用法
MODE_STREAM用法:
param.audiotrack_buffersize = AudioTrack.getMinBufferSize(freq, chnls, fmt);
AudioTrack audiotrack=new AudioTrack(AudioManager.STREAM_MUSIC,freq,chnls,fmt,param.audiotrack_buffersize,AudioTrack.MODE_STREAM);
getMinBufferSize(int sampleRateInHz, int channelConfig, int audioFormat) Returns the minimum buffer size required for the successful creation of an AudioTrack object to be created in the MODE_STREAM mode. |
MODE_STATIC用法:
int iMinBufSize = AudioTrack.getMinBufferSize(16000,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
这篇关于调试|Android平台的声音播放|AudioTrack|JNI|悲催的侧边键的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!