headphones

How to detect something in headphone jack on a Mac?

旧巷老猫 提交于 2019-12-18 03:40:39
问题 Is there a way to detect if something is plugged into the headphone jack of a Mac using c or objective-c ? Thanks 回答1: Should you still want to dive in and mess with this deep magic I was able to construct something together form the code I found here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/54013-hardware-volume-change-listener-callback.html You want to register a listen to the AudioProperties and catch any messages about 'kAudioSessionProperty_AudioRouteChange'. Using the

Detecting if headphones are plugged into iPhone

不打扰是莪最后的温柔 提交于 2019-12-17 15:45:11
问题 Does anyone know if you can detect if headphones are plugged into the iPhone, and if they aren't - disable sound from your application. I think I could manage disabling sound, but the detection part I have yet to find anything on. Thanks 回答1: http://developer.apple.com/iphone/library/samplecode/SpeakHere/Introduction/Intro.html In this project there is a code-snippet where it pauses recording if the headphones is unpluged. Maybe you can use it to achieve your result. Good luck! (edit) You

Droid Incredible Headphones Detection

こ雲淡風輕ζ 提交于 2019-12-13 03:51:04
问题 I'm developing an Android application for the Droid Incredible. When I plug in my headphones, an icon appears on the status bar, so I presume the phone must know headphones are present. My code produces beeps in response to various user inputs, but I discovered today that's a REALLY BAD idea when the user is wearing headphones. Ow. Does anybody have suggestions for how I can detect the presence of headphones programmatically, in Android?? Thanks, R. 回答1: I found the AudioManager class on the

what code can disable headphone jack for an android(4.4) device

∥☆過路亽.° 提交于 2019-12-13 02:24:12
问题 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. 回答1: As written here: How to mute audio in headset but let it play on speaker programmatically? AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); am.setMode(AudioManager.MODE_IN_CALL); am.setSpeakerphoneOn(false); And

Android, how to route the audio to speakers when headphones inserted?

筅森魡賤 提交于 2019-12-11 20:09:55
问题 I am looking for a way to play audio from an Android device's speaker, even when headphones are inserted. In fact, the typical behavior is that, when headphones are inserted, no audio is outputted form the speakers. However some apps, such the default Clock app (com.google.android.deskclock), are able to route the audio to the speaker even when the headphones are inserted. How can I programmatically get this behavior? I am looking for a solution that works (at least) on Nexus 5 devices,

MEDIA_BUTTON button event ACTION_DOWN and ACTION_UP received at the same time

▼魔方 西西 提交于 2019-12-11 13:23:32
问题 In my app I want to measure how long the media button press was. I registered a broadcastReceiver that listens to the media button press: (please excuse stupid mistakes as I am a beginner...) <receiver android:name="MyRec"> <intent-filter> <action android:name="android.intent.action.MEDIA_BUTTON"> <action android:name="android.intent.action.MEDIA_BUTTON"/> </action> </intent-filter> </receiver> The broadcastReceiver activates a method in an activity (not ideal, but this is just for testing

Force iPhone to read in data through headphone jack

亡梦爱人 提交于 2019-12-11 12:22:55
问题 I'm working on a project that ask the iPhone to receive data through headphone jack. I know it is doable, when I plug in the iPhone headphone it automatically change the input from the mac built in microphone to external microphone (I'm running the code on simulator) to record data. However, when I cut the headphone up and attach it to my signal generator, it seems that my mac cannot detect the external microphone anymore. Does anyone know how to manually set the headphone jack as the iPhone

IPhone audio: Volume faint ( but okay with headphones )

◇◆丶佛笑我妖孽 提交于 2019-12-11 07:45:38
问题 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 on minimum volume. but it is on maximum volume. now I plug in headphones. full volume. great! unplug headphones. Go to (2) It doesn't matter whether I start with the headphones plugged in or not. It seems to be an unrelated problem EDIT: this

How can I capture the AudioDestinationNode value when headphones are plugged in with Web Audio API?

我是研究僧i 提交于 2019-12-08 02:55:33
I've been looking for a solution that detects the difference between the default speakers and headphones on a computer. I understand that with Web Audio API, AudioDestinationNode represents the output device, where users hear audio. My question (to be specific) is whether or not it is possible to detect a change in the users' audio output device (wired/wireless headphones). If this is not possible, is there a way to use phonegap to do so, for computers as well as mobile devices? My goal is to initiate an event only when the AudioDestinationNode maps to headphones or external speakers. There's

Redirect microphone input to headphone output (soft playthru)

对着背影说爱祢 提交于 2019-12-07 22:48:18
问题 If I use my in-ear headphones with my macbook pro it takes me a few minutes until they are fitting perfectly (due to the foam bits on the headphones) :) My idea is to use internal macbook pro microphone to be able talk to somebody coming to my desk without having to remove the headphones every time. So kind of an 'intercom' thing which can be enabled by hitting a hotkey. First thought was to use applescript which could be easily used for pausing iTunes, but I could not find information about