IOS 7 iphone recording app Error: AudioQueueStart failed (-50)

ios record audio in background
avaudiosessionerrorcodecannotstartrecording
record audio in ios
call recording in ios programmatically swift
ios background audio
avaudiorecorder
record audio swift
auioclient_startio failed (561145187)

I have built a iphone recording app with titanium for ios 7 and i have noticed a bug that happens when you lock the phone.

When i run the app everything records fine i can close/minimize the app reopen the app all working great the issue occurs when i close the app and lock the phone click top right button.

If i then re-enter my passcode and open the app again and click record i get the following error in xcode and the top red background service bar flicks in then back out again.

And i get this outputted in xcode.

Error: couldn't get queue's maximum output packet size (-50)
Error: AudioQueueAllocateBuffer failed (-50)
Error: couldn't get queue's maximum output packet size (-50)
Error: AudioQueueAllocateBuffer failed (-50)

I have been told this maybe a issue with apple could this be true???

Here is a video showing the problem at the end when you see the top red bar flash in and out is where i get the errors above and recording fails.

https://www.youtube.com/watch?v=CvlAAlo3yts

Any help please???

I found the issue! seems like on iOS 7 there is a need to set this also (I assume this is only practically therefore it's hard to find, isn't written anywhere). Just add this code before calling any AudioQueue function:

AudioSessionInitialize(NULL,
                       NULL,
                       nil,
                       ( void *)(self)
                       );

UInt32 sessionCategory = kAudioSessionCategory_PlayAndRecord;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,
                        sizeof(sessionCategory),
                        &sessionCategory
                        );

AudioSessionSetActive(true);

AVAudioSessionErrorCodeCannotStartRecording when recording , IOS 7 iphone recording app Error: AudioQueueStart failed (-50) I have built a iphone recording app with titanium for ios 7 and i have noticed a bug that  iOS devices don't support recording to the MP3 encoding format. Actually, I don't think any of the iOS devices do. You have to choose an alternate format. Core Audio can read, but not write, MP3 files.

The answer from user3278923 solved the problem but here is the code for Obj-C:

AVAudioSession *session = [AVAudioSession sharedInstance];
NSError * error;
[session setCategory:AVAudioSessionCategoryRecord error:&error];
[session setActive:YES error:nil];

After recording:

AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryAmbient error:nil];
[session setActive:NO withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];e

AudioQueueStart, Previously the app has been able to record audio for transmition while Are there any special categories or options needed in the Audio Session to permit this on iOS 13? Failing that, is there a way to launch the app when the user presses the I have filed a bug report, as well as a DTS ticket with Apple. I followed your building a web browser tutorial and even the revised one for iOS 7 I loved it and it’s a GREAT way to learn!! I am very glad I found this site. I read that iOS 8 uses a new WebKit UI or something and it’s suppose to be faster. (They also added iPhone 6 & 6+) support as you probably know.

For swift:

https://developer.apple.com/documentation/avfoundation/avaudiosession

let audioSession = AVAudioSession.sharedInstance()
        do {
            try audioSession.setActive(true)
            try audioSession.setCategory(AVAudioSessionCategoryPlayback)
        } catch {
            print("Setting category to AVAudioSessionCategoryPlayback failed.")
        }

Audio Queue Services, AudioQueueStart. Begins playing or recording audio. SDKs. iOS 2.0+; macOS 10.5+; Mac Catalyst 13.0+; tvOS 9.0+. Framework. AudioToolbox. On This Page. i have a problem using the iPhone SDK (Beta 5). I want to playback a simple MP3-file. So i checked a lot of examples, read documentation and found a least the "AudioQueueTest" example. This is an simple example which is able to play MP3, WAV, from the command line. I ported the example to a simple application on the iPhone. Now the problem:

Appcelerator Developer Center Q&A Tag Feed (recording), Audio Queue Services enables you to record and play audio in linear PCM, and as a replacement for the Sound Manager in existing Mac apps. func AudioQueueStart(AudioQueueRef, UnsafePointer<AudioTimeStamp>?) the audio queue's audio converter failed to convert the requested number of sample frames. IPhone SDK Beta 2 Interface Builder Add a UIViewController Hi, I am trying the new SDK (beta 2). I didn't try the beta 1 before, because of the lack of IB. However, I am having a problem when trying to code a simple Hello World with a button, with a classic MVC design.

[PDF] iPhone SDK Development, 11/29/13--17:25: IOS 7 Audio Recording Bug Error: AudioQueueStart failed (-50) Error: AudioQueueStart failed (-50) ~~~ Meaning the recording fails would really appreciate a audio recording & playback, in a cross-platform way that will work in an iOS/Android App? Using 3.4.1GA tested on iphone 6 and iphone 4s​? Simple Personal Information Manager (PIM) is a basic app for iphone/ipod touch for managing personal information like email a/c, registration numbers, bank a/c. This is a one-stop app for conveniently looking up personal info when needed. Before we begin the tutorial, let’s check out the output of this tutorial.

50 ios 7, of the book on integrating your iPhone app with other apps and on working with be NULL, you don't crash or get an error (like Java's NullPointerException);. Audio can affect the human brain in the most powerful and profound ways. Using Apple's Core Audio, you can leverage all that power in your own Mac and iOS software, implementing features ranging from audio capture to real-time effects, MP3 playback to virtual instruments, web radio to VoIP support.

Comments
  • Can you show the code that causes this? Are you running this on a device? Or the simulator?
  • Hi Running on the device the code is in javascript unfortunately else i would share as i am using the titanium api here docs.appcelerator.com/titanium/3.0/#!/api/…
  • Wait, why can you share the code? Otherwise there is no way to help you out.
  • Hi Josiah the code is here github.com/appcelerator/KitchenSink/blob/master/Resources/ui/… its just from the kitchen sink
  • How are you handling the app life cycles when entering the background mode? And also coming out of background mode?
  • Hi mitul thanks for this i am using Titanium so i need to go into the ios sdk into phone and classes find every audio class where that instance appears and add the code?