Questions tagged [speaker]
233 questions
23
votes
8 answers
how to turn speaker on/off programmatically in android 4.0
I play a file through media player and I want to give options like speaker on/off, play though headset, bluetooth ,etc.
I tried the below code which works well for android 2.2 but I want something that can also work for 2.2 and 4.0 both.
Can you…

Mayuri Khinvasara
- 1,437
- 1
- 16
- 12
12
votes
1 answer
how to play sound from microphone to speaker directly on android?
in my application, I need to direct sound from microphone directly to speaker. No other actions.
I found a way to direct sound from microphone to earpiece by playing a file and setting speaker off. So I guess speaker can work similarly. However I…

A117
- 499
- 1
- 5
- 13
12
votes
3 answers
How do I enable the Android speaker during a call, from code?
This question has been asked and answered twice before on this site, but that code doesn't seem to work on modern phones at all. I'm working on an Android 4.2 and an Android 4.3 and neither seems to work.
I am playing an MP3 through a Media Player…

Viktor Zafirovski
- 449
- 1
- 5
- 15
7
votes
1 answer
Controlling the volume of forced-to-speaker audio
I'm playing an audio clip using OpenSL ES. In my code I have
audioManager.setMode(AudioManager.MODE_IN_CALL);
audioManager.setSpeakerphoneOn(true);
to force audio through the speaker while the headset is plugged in. It works fine, but I…

Nitrooo
- 73
- 1
- 4
7
votes
1 answer
iOS: Is it possible to send audio out both headphones and speakers at the same time?
We're looking to send some serial data out from the headphone jack, but would like to still be able to play audio from the speakers. Is it possible to send output to both? If so, is it possible to send different audio to each?

user1218464
- 1,011
- 2
- 12
- 22
6
votes
2 answers
python library to beep motherboard speaker
I need a python way to beep the system/motherboard speaker independent of the speakers attached to my computer. I don't always have the speakers turned on, so i need to beep the motherboard speaker.
All the libraries i've seen (winsound especially),…

user208145
- 369
- 4
- 13
6
votes
1 answer
Using android.net.rtp for VoIP
I'm trying to use the android.net.rtp library to make a VoIP application. Its audio stream can be both sent and received correctly.
My problem is: The speaker of the callee's phone works fine, but the headset is muted at all time (even if I turn off…

jane
- 81
- 3
6
votes
1 answer
Change Android Audio Record Default input Source
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…

lbrendanl
- 2,626
- 4
- 33
- 54
5
votes
1 answer
AVAudioSession : microphone headphone as input and iphone speaker as output
With iOS10 there are more possibilities to manage AUdioSession, but i couldn't manage to keep the headphone microphone as input while audio is going out through the iphone speaker.
The 'overrideOutputAudioPort' method below also override the input…

Damien Romito
- 9,801
- 13
- 66
- 84
5
votes
0 answers
How to manipulate audio channels volume with AudioTrack.setVolume after API 21
I'm trying to reproduce a mono wav file over just one of the stereo channels (speakers) that my smartphone has. I used to control this with
AudioTrack.setStereoVolume (float leftGain, float rightGain)
by setting one of these gains to zero.…

VMMF
- 906
- 1
- 17
- 28
5
votes
1 answer
How can i set MPVolumeView with swift?
i want to set Iphone Speaker default. My volume control swift code is below. It is works fine but when i tapped airplay button i see automatically select the second.(Iphone)
var wrapperView = UIView(frame:…

davudi
- 117
- 3
- 13
5
votes
1 answer
Samsung Galaxy S5 speakerphone\microphone issue
I have a strange device specific issue with Galaxy S5.
I'm using SIP (Linphone) to make call from Galaxy S5 to another device and when I enable speakerphone, the device starts to using its main microphone as noise reduction microphone and its…

Dimezis
- 1,541
- 11
- 24
5
votes
8 answers
AVAudioPlayer via Speakers
I got the following code:
- (id)init {
if (self = [super init]) {
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory),…

Mark
- 16,906
- 20
- 84
- 117
5
votes
1 answer
Play audio trough phone speaker of an android device
Is it possible to play audio trough the phone speaker of an android device?
The smaller speaker inside a phone that produces a low volume sound which can only be heard when listing closely with your ear against the phone.
Hopefully my description…

Luciano
- 2,691
- 4
- 38
- 64
5
votes
1 answer
How to use internal speaker to play sound while a 3.5mm jack plugged to record sound using an external microphone
I'm now programming an app to give vocal feedback through internal speaker while user performing some exercises.
Now I want to add a function to record the user's heartbeat and breathe through a stethoscope plugged in the phone by a 3.5mm jack. The…

Kyne H
- 133
- 1
- 7