我正在构建一个 android 应用程序,具有通过麦克风捕获声音并通过耳机播放的功能。为此,我使用了“AudioRecord”和“AudioTrack”。以下是我正在使用的部分代码,(仅供理解)
mInBufferSize = AudioRecord.getMinBufferSize(mSampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO, mFormat);
mOutBufferSize = AudioTrack.getMinBufferSize(mSampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO, mFormat);
mAudioInput = new AudioRecord(MediaRecorder.AudioSource.MIC,
mSampleRate, AudioFormat.CHANNEL_CONFIGURATION_MONO, mFormat,
mInBufferSize);
mAudioOutput = new AudioTrack(AudioManager.STREAM_MUSIC, mSampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO, mFormat,
mOutBufferSize, AudioTrack.MODE_STREAM);
但主要问题是我想以 mp3 格式录制传入的声音?请帮助我,我将非常感激......
提前致谢