Questions tagged [headphones]
146 questions
1
vote
1 answer
Programmatically trigger the action that a headphone pause button would do
I am trying to find a way to pause any playing media on the device, so I was thinking of triggering the same logic that is fired when a user press the headphone "middle button"
I managed to prevent music from resuming (after I pause it within my…

Sherbieny
- 117
- 3
- 17
1
vote
1 answer
IPhone audio: Volume faint ( but okay with headphones )
I'm getting unexpected audio behaviour:
problem -- iPhone device volume is very faint, but if I plug in headphones the volume is perfect
firstly, start app on iPhone the with nothing plugged in.
Audio works, but it is so faint, really as if it was…

P i
- 29,020
- 36
- 159
- 267
1
vote
0 answers
Streaming audio from remote service and play it in speakers
I have a streaming service running with help of RTP Stream class. I could able to stream audio from a remote IP. I have used wireshark to check the connection and it is receiving packets from the server. Now I would like to play the received audio…

cantona_7
- 1,127
- 4
- 21
- 40
1
vote
1 answer
Respond to Headphone events when using MediaPlayer
I'm using the built in MediaPlayer class in Android 2.1 to play audio & video files. However when I plug my headphones in and press the play pause button on them it fires up the built in music player which then plays as well as my app.
Is there a…

rustyshelf
- 44,963
- 37
- 98
- 104
1
vote
1 answer
Play sound in speaker while headphone is connected
How to play sound in speaker while a headphone or Bluetooth headset is connected?
I have tried the code below, but still the same:
AudioManager audioManager =…

hiwehuvelu
- 13
- 1
- 5
1
vote
1 answer
Android: headphone buttons with USB-C adapter
I want to make my headphone buttons work through an USB-C adapter because my phone is so hip and modern that it doesn't have a 3.5mm jack.
The buttons work: using the app "KeyEvent Display", I figured out that
Vol+ triggers "linux key code number"…

MrTomRod
- 345
- 2
- 16
1
vote
0 answers
How to handle headphone button long press event to android app instead of Google now?
In my android application I want to detect an headphone long press, but it seems long click of headphone button is by-default delievred to Google now application.
Below is my code :
KeyEvent event =…

Prashant
- 4,474
- 8
- 34
- 82
1
vote
2 answers
How to detect the headphone key press?
I am trying to detect if user press the headphone keys for that i am using 2 methods.
-(void)headsetMicrophoneDetection
{
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[[MPRemoteCommandCenter…

Kishore Kumar
- 4,265
- 3
- 26
- 47
1
vote
1 answer
How to control AVAudioPlayer using earPods remote control?
I'm using AVAudioPlayer to play music
I want to control playing from remote controls which are part of using headphones.
I've already this:
override func remoteControlReceivedWithEvent(event: UIEvent?) {
let rc = event!.subtype
…

Hreno Hrenovich
- 336
- 6
- 16
1
vote
0 answers
1
vote
0 answers
Take picture with headphones button
I want to take pictures with the camera when the headphones button is pressed.
But I'm getting a runtime error saying "Unable to start receiver...takePictureFailed".
Mi MainActivity:
public class MainActivity extends AppCompatActivity{
protected…

Giovany Arana Loaiza
- 31
- 5
1
vote
0 answers
read android headphone jack input signal
My question is the following.
I want to build an android app and use the android's headphone jack input mic to read voltages in the range 0V-2V and act accordingly for example if the voltage is 1.045 show a red circle on the screen if the voltage is…

george123
- 37
- 7
1
vote
3 answers
Audio through built-in speakers when earphones are plugged in headphone jack in Android
In my application, there is one Card Reader which uses Audio Jack of devices.Now, my problem is I want to produce sound from built-in speakers when Card Reader is intact in HeadPhone Jack of the device.
Here are the codes I have tried:
1) Using…

lifelongLearner
- 23
- 6
1
vote
1 answer
what code can disable headphone jack for an android(4.4) device
Im trying to build an app that can enable or disable the headphone jack on my Android 4.4 device . Once disabled nothing should be able to take control or activate it, even calling. I can root the device for this.
Any help would be appreciated.

jkb016
- 439
- 1
- 7
- 17
1
vote
0 answers
How to make virtual headphones in android/ios
I really have no idea where to start with this. I have android programming experience, but all my google searching are coming up as nothing. I am hoping someone in here can point me in the right direction.
I am trying to create an app that sends…

napkinsterror
- 1,915
- 4
- 18
- 27