¡@

Home 

2014/10/15 ¤U¤È 10:04:13

iphone Programming Glossary: audiosessiongetproperty

How can I detect if headphones are connected to an iPod touch G1?

http://stackoverflow.com/questions/1238758/how-can-i-detect-if-headphones-are-connected-to-an-ipod-touch-g1

to an iPod touch G1 There are many articles on how to detect if a microphone is connected to an iPod touch G2 via AudioSessionGetProperty kAudioSessionProperty_AudioInputAvailable but I have not seen any articles related to detection of headphones connected.. is useful once they connect up some headphones. My initial trials show that the AudioSession APIs and specifically the AudioSessionGetProperty with the kAudioSessionProperty_AudioRoute constant always reports back 'Headphone' even if headphones are not connected.. get with this method BOOL isHeadsetPluggedIn UInt32 routeSize sizeof CFStringRef CFStringRef route OSStatus error AudioSessionGetProperty kAudioSessionProperty_AudioRoute routeSize route if error route NULL route isEqual @ HeadsetInOut return YES return NO ..

record input coming from bluetooth headset in iPhone

http://stackoverflow.com/questions/18226255/record-input-coming-from-bluetooth-headset-in-iphone

problem if this is not zero check the audio route UInt32 size sizeof CFStringRef CFStringRef route OSStatus result AudioSessionGetProperty kAudioSessionProperty_AudioRoute size route NSLog @ route @ route if bluetooth headset connected should be HeadsetBT if..

how to route iPhone audio to the bluetooth headset

http://stackoverflow.com/questions/2375837/how-to-route-iphone-audio-to-the-bluetooth-headset

problem if this is not zero check the audio route UInt32 size sizeof CFStringRef CFStringRef route OSStatus result AudioSessionGetProperty kAudioSessionProperty_AudioRoute size route NSLog @ route @ route if bluetooth headset connected should be HeadsetBT if..

Detecting if headphones are plugged into iPhone

http://stackoverflow.com/questions/3575463/detecting-if-headphones-are-plugged-into-iphone

file. I found this code in the awakeFromNib method we do not want to allow recording if input is not available error AudioSessionGetProperty kAudioSessionProperty_AudioInputAvailable size inputAvailable if error printf ERROR GETTING INPUT AVAILABILITY d n error..

Detect if headphones (not microphone) are plugged in to an iOs device

http://stackoverflow.com/questions/3728781/detect-if-headphones-not-microphone-are-plugged-in-to-an-ios-device

record same time.html BOOL isHeadsetPluggedIn UInt32 routeSize sizeof CFStringRef CFStringRef route OSStatus error AudioSessionGetProperty kAudioSessionProperty_AudioRoute routeSize route Known values of route Headset Headphone Speaker SpeakerAndMicrophone..

Data format from recording using Audio Queue framework

http://stackoverflow.com/questions/3963827/data-format-from-recording-using-audio-queue-framework

inFormatID memset mRecordFormat 0 sizeof mRecordFormat UInt32 size sizeof mRecordFormat.mSampleRate XThrowIfError AudioSessionGetProperty kAudioSessionProperty_CurrentHardwareSampleRate size mRecordFormat.mSampleRate couldn't get hardware sample rate size.. mRecordFormat.mSampleRate couldn't get hardware sample rate size sizeof mRecordFormat.mChannelsPerFrame XThrowIfError AudioSessionGetProperty kAudioSessionProperty_CurrentHardwareInputNumberChannels size mRecordFormat.mChannelsPerFrame couldn't get input channel..

Detecting iPhone/iPod Touch Accessories

http://stackoverflow.com/questions/667196/detecting-iphone-ipod-touch-accessories

question Finally found it After initializing the Audio Session object AudioSessionInitialize you can make a call to AudioSessionGetProperty and get the value of kAudioSessionProperty_AudioInputAvailable. AudioSessionInitialize NULL NULL NULL NULL UInt32 propertySize.. kAudioSessionProperty_AudioInputAvailable. AudioSessionInitialize NULL NULL NULL NULL UInt32 propertySize micConnected AudioSessionGetProperty kAudioSessionProperty_AudioInputAvailable propertySize micConnected self updateMicStatus micConnected user created method..

Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?

http://stackoverflow.com/questions/6901363/detecting-the-iphones-ring-silent-mute-switch-using-avaudioplayer-not-worki

calling it like so BOOL deviceIsSilenced CFStringRef state UInt32 propertySize sizeof CFStringRef OSStatus audioStatus AudioSessionGetProperty kAudioSessionProperty_AudioRoute &propertySize &state if audioStatus kAudioSessionNoError NSLog @ audio route @ state Speaker..

Check if iPad is in silent mode [duplicate]

http://stackoverflow.com/questions/7546582/check-if-ipad-is-in-silent-mode

regardless. CFStringRef state UInt32 propertySize sizeof CFStringRef AudioSessionInitialize NULL NULL NULL NULL AudioSessionGetProperty kAudioSessionProperty_AudioRoute propertySize state if CFStringGetLength state 0 UIAlertView alert UIAlertView alloc initWithTitle..

iPhone AVCaptureDeviceInput How to Set Quality of Audio Capture?

http://stackoverflow.com/questions/7796263/iphone-avcapturedeviceinput-how-to-set-quality-of-audio-capture

@ Set Error Set Sample Rate ld lx c c c c u.propertyResult u.propertyResult u.a 3 u.a 2 u.a 1 u.a 0 u.propertyResult AudioSessionGetProperty kAudioSessionProperty_CurrentHardwareSampleRate F64datasize F64realSampleRate NSLog @ Get Error Current Sample Rate ld lx..

Detect Silent mode in iOS5?

http://stackoverflow.com/questions/7798891/detect-silent-mode-in-ios5

return NO #endif CFStringRef state UInt32 propertySize sizeof CFStringRef AudioSessionInitialize NULL NULL NULL NULL AudioSessionGetProperty kAudioSessionProperty_AudioRoute propertySize state if CFStringGetLength state 0 return NO else return YES This is no longer..

How to detect iphone is on silent mode

http://stackoverflow.com/questions/833304/how-to-detect-iphone-is-on-silent-mode

state nil UInt32 propertySize sizeof CFStringRef AudioSessionInitialize NULL NULL NULL NULL OSStatus status AudioSessionGetProperty kAudioSessionProperty_AudioRoute propertySize state if status kAudioSessionNoError return CFStringGetLength state 0 YES..

Use built-in mic if Headset is plugged in

http://stackoverflow.com/questions/9029442/use-built-in-mic-if-headset-is-plugged-in

following code. CFStringRef route UInt32 propertySize sizeof CFStringRef AudioSessionInitialize NULL NULL NULL NULL AudioSessionGetProperty kAudioSessionProperty_AudioRoute propertySize route if route NULL CFStringGetLength route 0 Silent Mode NSLog @ AudioRoute..

Recording mp3 instead of caf file

http://stackoverflow.com/questions/9399019/recording-mp3-instead-of-caf-file

inFormatID memset mRecordFormat 0 sizeof mRecordFormat UInt32 size sizeof mRecordFormat.mSampleRate XThrowIfError AudioSessionGetProperty kAudioSessionProperty_CurrentHardwareSampleRate size mRecordFormat.mSampleRate couldn't get hardware sample rate size.. mRecordFormat.mSampleRate couldn't get hardware sample rate size sizeof mRecordFormat.mChannelsPerFrame XThrowIfError AudioSessionGetProperty kAudioSessionProperty_CurrentHardwareInputNumberChannels size mRecordFormat.mChannelsPerFrame couldn't get input channel..