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
({
backgroundImage:'../images/record.png',
width:50,
height:60,
left:107,
top:4
});
buttonRecord.addEventListener( 'click', function()
{
if ( recording.recording )
{
file = recording.stop();
buttonRecord.backgroundImage = '../images/record.png';
buttonPlay.enabled = true;
}
else
{
buttonRecord.backgroundImage = '../images/stop.png';
recording.start();
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?
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!
-
(double post)
-
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.
-
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,