speakerphone

How to mute audio in headset but let it play on speaker programmatically?

孤街醉人 提交于 2019-12-28 04:21:08
问题 I am searching a work-around for my problem specified in this question: How to disable the wired headset programmatically in Java As mentioned there, I am getting audio in both my speakers and headphones. Can someone please tell me how to mute the audio in the headset programmatically , while letting it play undiminished on speaker? 回答1: AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); am.setMode(AudioManager.MODE_IN_CALL); am.setSpeakerphoneOn(true); And then

Change Android Audio Record Default input Source

一笑奈何 提交于 2019-12-23 10:19:55
问题 I am currently writing an app that calls for the recording and real time processing of audio data. For this, I am using the AudioRecord class. This works all well and good, except the default setting for recording audio on my primary testing device, a galaxy nexus, is to record from the back speaker. I am assuming most phones default record source will be the back, or bottom microphones, because when you are using the phone to call, your mouth is near the bottom. However, my app requires that

Change Android Audio Record Default input Source

旧巷老猫 提交于 2019-12-23 10:18:26
问题 I am currently writing an app that calls for the recording and real time processing of audio data. For this, I am using the AudioRecord class. This works all well and good, except the default setting for recording audio on my primary testing device, a galaxy nexus, is to record from the back speaker. I am assuming most phones default record source will be the back, or bottom microphones, because when you are using the phone to call, your mouth is near the bottom. However, my app requires that

Android set speakerphone on programmatically

旧城冷巷雨未停 提交于 2019-12-17 19:34:47
问题 I am trying to set speakerphone on in a call programmatically using audiomanager.setSpeakerphoneOn(true) in a service but it seems it is not working and I don't know why. Should I do something else? Thanks 回答1: check if your manifest file has the permissions need to do this operation. I think this is the permission you need MODIFY_AUDIO_SETTINGS 回答2: In android 4.1 and more when you make a call the phone turn off the speaker phone automatically. So What you need to do is to add the

Switching between earpiece and speakerphone on button press

爷,独闯天下 提交于 2019-11-30 14:01:58
问题 I am trying to play audio from both the speakerphone and earpiece by having a button toggle between the two. The problem is that I am trying to default the audio to play from the earpiece, but nothing comes out. Then when I press the button to toggle to speakerphone, still no audio plays. I am playing from a local raw file. I have android.permission.MODIFY_AUDIO_SETTINGS in the Manifest as well. Here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

Switching between earpiece and speakerphone on button press

无人久伴 提交于 2019-11-30 09:19:27
I am trying to play audio from both the speakerphone and earpiece by having a button toggle between the two. The problem is that I am trying to default the audio to play from the earpiece, but nothing comes out. Then when I press the button to toggle to speakerphone, still no audio plays. I am playing from a local raw file. I have android.permission.MODIFY_AUDIO_SETTINGS in the Manifest as well. Here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = getActivity().getBaseContext(); am = (AudioManager) context.getSystemService

Turn on speakerphone whenever an outgoing call is made

穿精又带淫゛_ 提交于 2019-11-29 02:24:32
My requirement is to turn on speakerphone whenever an outgoing call is initiated. I tried the following code, but it is not working. In fact, speakerphone turns on when in the middle of a call, a second call comes ! package in.co.allsolutions; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.TelephonyManager; import android.util.Log; //import android.view.View; import android.widget.Toast; import android.media.AudioManager; public class MyTelephonyBroadcastReceiver extends

Android set speakerphone on programmatically

血红的双手。 提交于 2019-11-28 10:59:16
I am trying to set speakerphone on in a call programmatically using audiomanager.setSpeakerphoneOn(true) in a service but it seems it is not working and I don't know why. Should I do something else? Thanks check if your manifest file has the permissions need to do this operation. I think this is the permission you need MODIFY_AUDIO_SETTINGS Eran Katsav In android 4.1 and more when you make a call the phone turn off the speaker phone automatically. So What you need to do is to add the speakerphone on in the reciever that listens for the call being made when the state is "offHook" and even put a

Turn on speakerphone whenever an outgoing call is made

試著忘記壹切 提交于 2019-11-27 16:46:11
问题 My requirement is to turn on speakerphone whenever an outgoing call is initiated. I tried the following code, but it is not working. In fact, speakerphone turns on when in the middle of a call, a second call comes ! package in.co.allsolutions; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.TelephonyManager; import android.util.Log; //import android.view.View; import android.widget

How to mute audio in headset but let it play on speaker programmatically?

孤者浪人 提交于 2019-11-27 15:21:47
I am searching a work-around for my problem specified in this question: How to disable the wired headset programmatically in Java As mentioned there, I am getting audio in both my speakers and headphones. Can someone please tell me how to mute the audio in the headset programmatically , while letting it play undiminished on speaker? AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); am.setMode(AudioManager.MODE_IN_CALL); am.setSpeakerphoneOn(true); And then play the sound through the AudioManager.STREAM_SYSTEM stream. When the sound's finished playing be sure to