问题
I am making a application to record audio from bluetooth headset. After that, the signal sound from headset will be played in to speaker of android phone. However, my problem is that some signal from microphone of android phone is also played. I want to mute microphone of android during playing. Is it possible. I am refering some link but it does not useful. Please give me one solution to turn of my microphone. This is my setting
_audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int maxJitter = AudioTrack.getMinBufferSize(SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT);
track = new AudioTrack(AudioManager.MODE_IN_COMMUNICATION, SAMPLE_RATE, AudioFormat.CHANNEL`enter code here`_OUT_MONO,
AudioFormat.ENCODING_PCM_16BIT, maxJitter, AudioTrack.MODE_STREAM);
_audioManager.startBluetoothSco();
_audioManager.setMode(AudioManager.STREAM_SYSTEM);
_audioManager.setMicrophoneMute( false);
_audioManager.setSpeakerphoneOn(true);
setVolumeControlStream(AudioManager.MODE_IN_COMMUNICATION);
This is my expected work
You can download the source code at Audio record and speak via headset bluetooth来源:https://stackoverflow.com/questions/27777305/how-to-mute-microphone-when-recording-from-headset