问题
I am having some issues with the AudioRecord class. I have an app that records audio while someone is listening to audio through headphones. In this scenario, it works fine. Users are able to record without an issue. Any user using headphones with a built-in mic are not able to record at all. My class creates the .wav file from PCM data but no audio is being input from the mic. Its all silence.
I use the following the init my AudioRecorder:
extAudioRecorder = new ExtAudioRecorder(true,
AudioSource.MIC,
44100,
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT);
Is there a problem trying to record using headphones w/ a mic in Android?
EDIT:
Just found out that the headphones dont even have to have a MIC and the internal mic is still disabled. Anyone know how to get around this?
http://code.google.com/p/android/issues/detail?id=4095
回答1:
Found out that some phones disable the built-in microphone when headphones are plugged in. Mostly Samsung devices.
回答2:
to force the use of builtin mic (at least on samsung devices), you can use MediaRecorder.AudioSource.CAMCORDER as source
来源:https://stackoverflow.com/questions/11077161/android-audiorecord-headphones-with-mic