Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Recording audio crashes on iOS 4.0 Ti SDK 1.3.1 with libTiCore-7.a patch

Hi, I can't find anything in this forum related to this, so hopefully someone has an idea. I have an app that has been shipping on iPhone for about three months. I am now trying to update it for iOS 4.0 (the original app crashes out immediately on 4.0, as expected). I did the 4.0 libTiCore-7.a patch per Jeff Haynie's blog and the app now works great on 4.0; no crashing. With one exception… and this is even more frustrating as it will not crash in the emulator, only on the device!

I have the below code to allow the user to press a button and record (other buttons etc to playback of course). The code is pretty much taken straight from KS and works perfectly in the emulator and on a pre- iOS 4.0 device. In the app, I tap the record button, app sits for a second and then crashes back to Springboard. I'm not 100% the crash is happening in the record, but I get no response from the app between the tapping of the record button and the crash.

And again, it works fine in the emulator. Any ideas? Thanks in advance!

// create record button
var buttonRecord = Ti.UI.createButton
buttonRecord.addEventListener( 'click', function()
    if ( recording.recording )
        file = recording.stop();
        buttonRecord.backgroundImage = '../images/record.png';
        buttonPlay.enabled = true;
        buttonRecord.backgroundImage = '../images/stop.png';
        buttonPlay.enabled = false;
buttonView.add( buttonRecord );

EDIT: Quick update, with the "recording.start();" line commented out, the app does not crash on the device. It would be great to hear from Appcelerator folks if audio recording should be working on iOS 4.0. Thanks!

EDIT 2: I just noticed the documentation indicates that Titanium.Media.AudioRecorder.stop() returns void, whereas the KS example (and other examples I've seen for recording audio) use the stop() function to return a reference to the recorded audio data. I assume the docs are wrong?

— asked June 22nd 2010 by karlo kilayko
  • audio
  • crash
  • emulator
  • iphone
  • recording

4 Answers

  • Accepted Answer

    Just posting an answer so I can mark it as 'best': This has been fixed in v1.3.3. Works great! Thanks very much Appcelerator team!

    EDIT: oops, I guess I can't mark my own response as the best answer. If someone wants to post that this is fixed in 1.3.3, I will mark it as the best answer. Thanks!

    — answered July 8th 2010 by karlo kilayko
  • (double post)

    — answered June 22nd 2010 by Sj Singh
  • Can you run KS on your iOS4 and see if it works thru there? You can do that by opening up the KS project in xCode then do Debug on Device.

    If the problem still occurs, files a bug here: https://appcelerator.lighthouseapp.com/projects/32238-titanium-mobile/tickets

    They have to test over 50 combinations so im sure one or two things might have slid past.

    — answered June 22nd 2010 by Sj Singh
    • I haven't yet checked KS on the device, but I will do so before (and after ;) trying the 1.3.2 RC. Thanks for the cool tip on using Xcode to directly test on device; I was going to provision it!

      — commented June 22nd 2010 by karlo kilayko
    • Okay, sorry for the delay - Xcode wouldn't let me run on device without a provision, so i just went that route and…. KS exhibits the same behaviour: "Record" button highlights, hangs for a second, then KS crashes out to SpringBoard. Again this does not happen in emulator, only on 3GS device. I will post an issue to lighthouse.

      — commented June 22nd 2010 by karlo kilayko
  • I'm having the same issue, I have an App that was ready to be published to the AppStore but can't publish it now cause the Audio Recording doesn't work on my iPhone 3GS, it does exactly the same thing where it hangs for a couple of seconds then it crashes.

    Does anyone know the solution to this, this has to be fixed by the Appcelerator team please.

    Many thanks for your help in advance,

    — answered July 8th 2010 by Samuel Lopez
    1 Comment
    • This has been fixed by the Appcelerator guys in version 1.3.3. Worked great for me (though Apple has yet to approve/reject my app update submission)

      — commented July 8th 2010 by karlo kilayko
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.