headset

How to detect if a bluetooth headset plugged or not IOS 8?

强颜欢笑 提交于 2019-11-29 10:23:07
问题 In my project, I use AVAudioSession to detect any headphone is plugged or unplugged. But in this case, I can't detect when bluetooth device is plugged. Here is my code for headphone state. - (void)audioRouteChangeListenerCallback:(NSNotification*)notification { NSDictionary *interuptionDict = notification.userInfo; NSInteger routeChangeReason = [[interuptionDict valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue]; switch (routeChangeReason) { case

How to read/send data using the Android Devices 3.5mm headset jack?

白昼怎懂夜的黑 提交于 2019-11-28 15:35:54
I was just stumbling around EE Stack and found this post: What protocol does a headphone jack use. And it sparked some curiosity in me, and I figure, if the iPhone can do it, I want to as well. Does any one know of any projects that are doing this now or whether or not it's even possible? UPDATE RIP mik3y You are basically asking how to turn the microphone input into a modem input. A variant of this clever technique is used commercially by Square for their magstripe readers on both iOS and Android devices. To do so requires getting access to the raw PCM stream from Android and decoding the

Detect headset button click on iPhone SDK

南楼画角 提交于 2019-11-28 07:03:11
Is there a way to detect the headset's play/pause button click? I managed to detect the volume buttons clicks using: AudioSessionAddPropertyListener( kAudioSessionProperty_CurrentHardwareOutputVolume , audioVolumeChangeListenerCallback, self ); But I can't find an AudioSessionProperty for the center button. What's the way to do that? Can Everything that's done from outside your app is considered a "Remote Event". If you double-tap the Home button and press Play/Pause there, it's the equivalent of pressing the play/pause button on the headset (Same for double tapping for next, and triple

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

How to read/send data using the Android Devices 3.5mm headset jack?

坚强是说给别人听的谎言 提交于 2019-11-27 09:18:21
问题 I was just stumbling around EE Stack and found this post: What protocol does a headphone jack use. And it sparked some curiosity in me, and I figure, if the iPhone can do it, I want to as well. Does any one know of any projects that are doing this now or whether or not it's even possible? UPDATE RIP 回答1: You are basically asking how to turn the microphone input into a modem input. A variant of this clever technique is used commercially by Square for their magstripe readers on both iOS and

Detect headset button click on iPhone SDK

ぃ、小莉子 提交于 2019-11-27 01:46:32
问题 Is there a way to detect the headset's play/pause button click? I managed to detect the volume buttons clicks using: AudioSessionAddPropertyListener( kAudioSessionProperty_CurrentHardwareOutputVolume , audioVolumeChangeListenerCallback, self ); But I can't find an AudioSessionProperty for the center button. What's the way to do that? 回答1: Everything that's done from outside your app is considered a "Remote Event". If you double-tap the Home button and press Play/Pause there, it's the