avaudiosession

AudioSession input from bluetooth output to line out or speaker

帅比萌擦擦* 提交于 2019-12-01 08:21:02
问题 Once an audio session has been set up the following code allows bluetooth input. UInt32 allowBluetoothInput = 1; AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof (allowBluetoothInput), &allowBluetoothInput); This code looks like it only allows bluetooth input however this code also routes the audio output to the bluetooth device (in the case of a bluetooth headset). I would like to route the audio output out of the line out or speaker when the input

App crashes with AVAudioSession privateBeginInterruption

[亡魂溺海] 提交于 2019-12-01 08:08:59
I'm testing my app on device (a soundboard) and it crashes with a EXC_BAD_ACCESS , I have use Breakpoints and the error came from [AVAudioSession privateBeginInterruption] The crash happens following this pattern: The app is launched, we see the main menu A main menu button is pressed and a soundboard view is loaded (push), some buttons are pressed here and sounds are played. Return to main menu ( [self.navigationController popViewControllerAnimated:YES]; ) App enters background When app enters foreground and the menu button of the soundboard is pressed the app crashes. I have no idea what is

this app was developed and works fine under ios 5.0, but crashes under ios 4.3

故事扮演 提交于 2019-12-01 06:54:00
问题 I developed an iPhone app under iOS 5.0, and it works fine. But when it comes to iOS 4.3(Base SDK = latest iOS 5.0, compiler = Apple LLVM 3.0, Deployment Target = iOS 4.3), it crashes after launching. The output around crash point looks like: 2011-12-06 16:25:08.177 FMWei[466:c203] -[AVAudioSession setMode:error:]: unrecognized selector sent to instance 0x706a7f0 2011-12-06 16:25:08.181 FMWei[466:c203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-

App crashes with AVAudioSession privateBeginInterruption

风格不统一 提交于 2019-12-01 06:32:06
问题 I'm testing my app on device (a soundboard) and it crashes with a EXC_BAD_ACCESS , I have use Breakpoints and the error came from [AVAudioSession privateBeginInterruption] The crash happens following this pattern: The app is launched, we see the main menu A main menu button is pressed and a soundboard view is loaded (push), some buttons are pressed here and sounds are played. Return to main menu ( [self.navigationController popViewControllerAnimated:YES]; ) App enters background When app

Check for mic permission on iOS 7 without showing prompt

陌路散爱 提交于 2019-12-01 05:59:09
问题 The only documented method for checking mic permission on iOS 7 that I could find is requestRecordPermission documented on AVAudioSession . https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioSession/requestRecordPermission: However, the very act of checking permission using this method will display an alert asking user for permission if user hasn't already made a decision, which can

AVCaptureSession addInput causing glitch in background audio

╄→尐↘猪︶ㄣ 提交于 2019-12-01 05:32:41
I'm making a video capturing iOS app and I want to be able to record audio from the microphone while allowing background music to play. I can do all of this but the background audio skips (pauses briefly) whenever the view with the camera enters and exits the foreground. I have isolated the bug to AVCaptureSession addInput : AVCaptureSession session = [[AVCaptureSession alloc] init]; session.automaticallyConfiguresApplicationAudioSession = NO; AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; AVCaptureDeviceInput *audioDeviceInput =

AVCaptureSession addInput causing glitch in background audio

喜夏-厌秋 提交于 2019-12-01 04:44:03
问题 I'm making a video capturing iOS app and I want to be able to record audio from the microphone while allowing background music to play. I can do all of this but the background audio skips (pauses briefly) whenever the view with the camera enters and exits the foreground. I have isolated the bug to AVCaptureSession addInput : AVCaptureSession session = [[AVCaptureSession alloc] init]; session.automaticallyConfiguresApplicationAudioSession = NO; AVCaptureDevice *audioDevice = [AVCaptureDevice

requestRecordPermission does nothing

一曲冷凌霜 提交于 2019-11-30 22:41:47
问题 Since the update of iOS 7 there has been some changes with recording applications. I have an app that used to work with iOS 5 and 6, but when I tried to run it on iOS 7 - recording didn't respond. I checked the internet and saw there's a new method that needs to be called. I tried to place this code in viewDidAppear: if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { if([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]) { [[AVAudioSession

AVAudioSession setCategory not working

瘦欲@ 提交于 2019-11-30 21:56:27
I have a video capturing app and I want to be able to play background music while recording audio+video. I can accomplish this if I set the AVAudioSession category to PlayAndRecord in didFinishLaunchingWithOptions . However, this causes a glitch in the audio whenever the view with the camera enters or exits the foreground, and its apparently impossible to get rid of: https://forums.developer.apple.com/message/74778#74778 I can live with the glitch if it just happens when I start/stop recording video, but that means I need to change the AVAudioSession category from Ambient to PlayAndRecord when

iOS AudioSessionSetActive() blocking main thread?

戏子无情 提交于 2019-11-30 19:44:20
in my iOS app, I'm trying to implement "ducking": while my app plays a short "command-like" sound, any background music should be lowered in volume. Having finished playing the sound, the music volume should go back to its original value. As implemented, ducking basically works as expected. However, when I call AudioSessionSetActive(NO) in audioPlayerDidFinishPlaying: in order to end ducking, there is a small pause in any UI updates that occur at this point of time. This involves custom drawing, as well as for ex. automatic scrolling of text and so on. Now, here's the question: Is this a known