{ "id": "61812", "key": "TIMOB-1180", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11224", "name": "Release 1.4.0", "archived": true, "released": true, "releaseDate": "2010-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:55:26.000+0000", "created": "2011-04-15T02:45:58.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "audio", "crash", "emulator", "ios", "iphone", "recording" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:55:26.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

I have the below code to allow the user to press a button and\nrecord (other buttons etc to playback of course). The code is\npretty much taken straight from KS and works perfectly in the\nemulator and on a pre- iOS 4.0 device. In the app, I tap the record\nbutton, app sits for a second and then crashes back to Springboard.\nI'm not 100% the crash is happening in the record, but I get no\nresponse from the app between the tapping of the record button and\nthe crash.
\nAnd again, it works fine in the emulator. Any ideas? Thanks in\nadvance!

\n
\n// create record button\nvar buttonRecord = Ti.UI.createButton\n({\n    backgroundImage:'../images/record.png',\n    width:50,\n    height:60,\n    left:107,\n    top:4\n});\nbuttonRecord.addEventListener( 'click', function()\n{\n    if ( recording.recording )\n    {\n        file = recording.stop();\n        buttonRecord.backgroundImage = '../images/record.png';\n        buttonPlay.enabled = true;\n    }\n    else\n    {\n        buttonRecord.backgroundImage = '../images/stop.png';\n        recording.start();\n        buttonPlay.enabled = false;\n    }\n});\nbuttonView.add( buttonRecord );\n
\n

If I comment out \"recording.start();\" there are (of course) no\ncrashes.

{html}", "attachment": [], "flagged": false, "summary": "Recording audio crashes on 3GS device (but not in emulator!) under iOS 4.0 Ti 1.3.2", "creator": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125016", "author": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Sorry, meant to mention I also tested this with KS e37f5dd and\nit exhibits the same behavior (which is pretty much expected, since\nI basically copied the KS code for my app)

{html}", "updateAuthor": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:45:59.000+0000", "updated": "2011-04-15T02:45:59.000+0000" }, { "id": "125017", "author": { "name": "ranguard", "key": "ranguard", "displayName": "ranguard", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'm getting this issue as well - works fine in simulator - but\ncrashes on the phone

{html}", "updateAuthor": { "name": "ranguard", "key": "ranguard", "displayName": "ranguard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:45:59.000+0000", "updated": "2011-04-15T02:45:59.000+0000" }, { "id": "125018", "author": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "body": "{html}

What compression codecs and formats are you trying?

\n

(I've yet to try my recorder on a 4.0 iOS device yet)

\n

try changing over to:

\n

recording.compression = Ti.Media.AUDIO_FORMAT_AAC;
\nrecording.format = Ti.Media.AUDIO_FILEFORMAT_MP4A;

\n

which I find gives great quality/filesize for the 3GS (on iOS\n< 4.0) - but crashes the 3G, where I had to use\nTi.Media.AUDIO_FILEFORMAT_CAF and\nTi.Media.AUDIO_FORMAT_LINEAR_PCM

{html}", "updateAuthor": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "created": "2011-04-15T02:45:59.000+0000", "updated": "2011-04-15T02:45:59.000+0000" }, { "id": "125019", "author": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'm using these:

\n

recording.compression = Ti.Media.AUDIO_FORMAT_ULAW;
\nrecording.format = Ti.Media.AUDIO_FILEFORMAT_WAVE;

\n

I tried with alternate compression/formats (including the combo\nyou recommend above), but the behavior is the same: works fine on\nemulator, crashes on device.

\n

Thanks for the suggestion, though!

{html}", "updateAuthor": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:00.000+0000", "updated": "2011-04-15T02:46:00.000+0000" }, { "id": "125020", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Have you made sure that your audio session mode is one of\nTitanium.Media.AUDIO_SESSION_MODE_RECORD or\nTitanium.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD?

\n

Assigning to Blain because he is currently testing this under\n4.0.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:00.000+0000", "updated": "2011-04-15T02:46:00.000+0000" }, { "id": "125021", "author": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thanks for updating the ticket, Stephen! I am setting the\nsession mode (I neglected to include that bit in the code above). I\nhave it set to:

\n
\nrecording.audioSessionMode = Titanium.Media.AUDIO_SESSION_MODE_RECORD;\n
\n

I haven't tried PLAY_AND_RECORD but would be happy to if you\nthink it will make a difference. I also haven't tried all\npermutations/combinations of compression and format, except for the\ntwo indicated above.

\n

Thanks again!

{html}", "updateAuthor": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:00.000+0000", "updated": "2011-04-15T02:46:00.000+0000" }, { "id": "125022", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

PLAY_AND_RECORD is actually going to be the same\ntype of audio session (it allows recording and playback at the same\ntime), so this will not fix your problem. We're working on it right\nnow and I will be sure to close this bug once we have it resolved.\nThis is a priority for 1.4 so expect it to be fixed by official\nrelease at the latest.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:00.000+0000", "updated": "2011-04-15T02:46:00.000+0000" }, { "id": "125023", "author": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Ah, that's what I assumed. Thanks again for making this a\npriority! You guys rock!!

{html}", "updateAuthor": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:00.000+0000", "updated": "2011-04-15T02:46:00.000+0000" }, { "id": "125024", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [eadace1da081b2cbd8a5aee4c877cb006d221861])\nCloses #1180: In pre-iOS 4, the device had its number\nof input channels set before setting RECORD modes. In iOS 4 this\nchanged, presumably because the number of input chanels can change\nbetween recording sessions - presumably this was to deal with bugs\ninvolving swapping out the recording-enabled earbuds on Touch\ndevices. \nhttp://github.com/appcelerator/titanium_mobile/commit/eadace1da081b...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:00.000+0000", "updated": "2011-04-15T02:46:00.000+0000" }, { "id": "125025", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Haw. I just realized why this would be the case in iOS4. Up\nuntil now, all recordings are single channel because there's only\none microphone. But what new feature was brought out with the\niPhone 4? Yup, a second microphone, technically making two input\nchannels. D'oh.

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:01.000+0000", "updated": "2011-04-15T02:46:01.000+0000" }, { "id": "125026", "author": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Awesome! Again, I cannot say enough how cool you guys are! Many\nmany thanks!

{html}", "updateAuthor": { "name": "karlo", "key": "karlo", "displayName": "karlo ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:46:01.000+0000", "updated": "2011-04-15T02:46:01.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }