How to mute downlink voice call on android? - android

I work with AOSP 4.4.2 build. We'd like to mute downlink voice call sound for a while. How can we that? We already test with AudioManager's setStreamMute, setStreamVolume, but it was not working on our projects.
Like a mute a camera shutter sounds, we now finding some solution on audio_policy.

Related

AOSP: Mute the microphone only on an application and not on the whole device

In Android, it is possible to mute the microphone with:
AudioManager.setMicrophoneMute(boolean mute)
However, this method mutes the microphone for the whole device and not just the application.
As an AOSP developer, is it possible to mute the microphone only for an application and not on the whole device. I know it should be possible.

How to configure OpenSL to work with ear speaker other than main speaker or headphones

I've tried the native-audio code sample in android NDK. When i try to record some speech and then play it back it works fine. It uses the main speaker(loud speaker) for the speech playback. I want to modify the code so that the speech is played in the ear speaker instead of the main speaker. Any help?
I solved the problem and I've found a google group of related topic. It was really helpful. Here's the link:
https://groups.google.com/forum/#!topic/android-ndk/O-hufEm20cU
I tested it in the native-audio example provided with android NDK. You've to take interface of android configuration first and then set stream type to STREAM_VOICE after creating the audio player.
// Code for working with ear speaker by setting stream type to STREAM_VOICE
SLAndroidConfigurationItf playerConfig;
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_ANDROIDCONFIGURATION, &playerConfig);
SLint32 streamType = SL_ANDROID_STREAM_VOICE;
result = (*playerConfig)->SetConfiguration(playerConfig, SL_ANDROID_KEY_STREAM_TYPE, &streamType, sizeof(SLint32));

Android Speech Recognition while music is playing

referencing to Hoans answer here Jelly Bean Beep In Speech Recognition I tried to implement a speech recognizer in the background.
And it works all fine. The service runs in background and listens to words the user say.
My problem is:
If a music player is running and the speech recognizer restarts, the system sound stream is muted to prevent the beep sound of speech recognition. But muting this stream paues and mutes the music player, too.
Does anyone have an idea how to prevent the beep sound without muting the whole system?
I already tried to mute another stream but the system stream is the only one muting the beep.
I test on a Nexus 4 with Android 4.4
Best regards.

Turn off microphone in android

I want to turn off or disable the microphone during a call.
I searched, but I got almost nothing. Some people say it is not possible in android.
How do I turn off the microphone?
You can't completely disable the microphone. But you can play around the audio manager, to mute it etc...
AudioManager

Android - How to disable sound on video recording start?

On Android when you start recording video in your app there is a notification sound. Is there a reliable way to disable it?
For non-rooted devices, if the firmware allows muting that sound, you can mute it by using AudioManager.setStreamMute() on STREAM_MUSIC (or STREAM_SYSTEM on some devices) before recording and unmute when recording starts. It won't work if the firmware doesn't allow this. In this case, there is no way to disable it other than rooting it.

Categories

Resources