![](/img/trans.png)
[英]Android audio recording using phone microphone when handsfree is attached
[英]How to set recording source to device microphone when a handsfree is connected?
遵循此問題,我使用AudioRecord
從內部設備Mic進行錄音,如下所示:
recorder = new AudioRecord(AudioSource.MIC, sRate,
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT, N);
連接耳機時,我需要從內部麥克風錄音(而不是耳機的麥克風)。 setRouting()
setParameters()
, setRouting()
, setMode()
方法對AudioRecord
有幫助嗎?
采用
MediaRecorder.AudioSource.VOICE_DOWNLINK
代替
AudioSource.MIC
用於音頻源
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.