audiosession

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

AudioQueueStart fail -12985

喜你入骨 提交于 2019-11-29 06:42:54
I made a streaming music player and it works fine in the foreground. But in the background iOS4, it doesn't play the next song automatically. ( remote control works ) The reason is AudioQueueStart return -12985 . I already check the audio session. it just fine. I use AudioQueueStart when it start to play the music. How can you remove AudioQueueStart ? - (void)play { [self setupAudioQueueBuffers]; // calcluate the size to use for each audio queue buffer, and calculate the // number of packets to read into each buffer OSStatus status = AudioQueueStart(self.queueObject, NULL); } I read the answer

iOS: Using Bluetooth audio output (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput) AudioSession

主宰稳场 提交于 2019-11-29 02:28:40
I have several questions to the CoreAudio AudioSession framework related to several Bluetooth tasks and I hope someone can help me with these issues or at least can confirm my latest findings. The usecase is a navigation app that wants to connect with a bluetooth enabled radio which supports both, HFP and A2DP. I have read the whole AudioSession Programming Guidelines but I have still some open issues especially using audio output through Bluetooth. Bluetooth HFP audio output (kAudioSessionOutputRoute_BluetoothHFP) is only possible in case of AudioSession kAudioSessionCategory_PlayAndRecord is

AVAudioPlayer, using AmbientSound session, is not playing when app is in background

强颜欢笑 提交于 2019-11-28 10:39:46
问题 If this is in the apple doc then I've not been able to find it - hoping someone can help: My app plays occasional short audio clips - I want the audio to mix in with audio playing from other apps in the background like the iPod app - but I also want it to carry on playing these audio clips when the app is running in background. I have set "App plays audio" in the Required Background Modes settings in info.plist (the app is also using location services too so that is also set in there) My app

AudioQueueStart fail -12985

自古美人都是妖i 提交于 2019-11-28 00:29:57
问题 I made a streaming music player and it works fine in the foreground. But in the background iOS4, it doesn't play the next song automatically. ( remote control works ) The reason is AudioQueueStart return -12985 . I already check the audio session. it just fine. I use AudioQueueStart when it start to play the music. How can you remove AudioQueueStart ? - (void)play { [self setupAudioQueueBuffers]; // calcluate the size to use for each audio queue buffer, and calculate the // number of packets

iOS: Using Bluetooth audio output (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput) AudioSession

荒凉一梦 提交于 2019-11-27 16:44:11
问题 I have several questions to the CoreAudio AudioSession framework related to several Bluetooth tasks and I hope someone can help me with these issues or at least can confirm my latest findings. The usecase is a navigation app that wants to connect with a bluetooth enabled radio which supports both, HFP and A2DP. I have read the whole AudioSession Programming Guidelines but I have still some open issues especially using audio output through Bluetooth. Bluetooth HFP audio output