{ "id": "116509", "key": "TIMOB-14396", "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": "15646", "description": "2013 Sprint 18", "name": "2013 Sprint 18", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15690", "description": "2013 Sprint 18 API", "name": "2013 Sprint 18 API", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-09-13T22:06:43.000+0000", "created": "2013-06-26T19:14:02.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios7", "module_media", "qe-closed-3.1.3", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-13T22:06:56.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": "There are changes to AudioToolbox with iOS 7. I noticed this because an app I'm building with Ti 3.1.1 and iOS SDK 6 is not properly playing audio when I set:\r\n\r\n{code}\r\nTi.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD;\r\n\r\nvar sound = Ti.Media.createSound({\r\n\turl:soundFile.getNativePath(),\r\n\tallowBackground:false,\r\n});\r\nsound.play();\r\n{code}\r\n\r\nAlso, with iOS 7 you now must request Mic access, so we'll need new methods or properties to deal with this.", "attachment": [], "flagged": false, "summary": "iOS7: AudioToolbox changes", "creator": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "269170", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Testing Code \n{code}\nvar win = Titanium.UI.createWindow();\n\nTi.Media.requestAuthorization(function(e){\n if (e.success) {\n startRecorder();\n } else {\n alert('Access to Recorder is not allowed');\n \tvar label = Ti.UI.createLabel({\n \t\ttext:'Permission to use recorder is denied.'\n \t});\n \twin.add(label);\n }\n});\n\nfunction startRecorder(){\n\tTitanium.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD;\n\tvar recording = Ti.Media.createAudioRecorder();\n\n\t// default compression is Ti.Media.AUDIO_FORMAT_LINEAR_PCM\n\t// default format is Ti.Media.AUDIO_FILEFORMAT_CAF\n\n\t// this will give us a wave file with µLaw compression which\n\t// is a generally small size and suitable for telephony recording\n\t// for high end quality, you'll want LINEAR PCM - however, that\n\t// will result in uncompressed audio and will be very large in size\n\trecording.compression = Ti.Media.AUDIO_FORMAT_ULAW;\n\trecording.format = Ti.Media.AUDIO_FILEFORMAT_WAVE;\n\n\tTi.Media.addEventListener('recordinginput', function(e) {\n\t\tTi.API.info('Input availability changed: '+e.available);\n\t\tif (!e.available && recording.recording) {\n\t\t\tb1.fireEvent('click', {});\n\t\t}\n\t});\n\n\tvar file;\n\tvar timer;\n\tvar sound;\n\n\n\tvar label = Titanium.UI.createLabel({\n\t\ttext:'',\n\t\ttop:150,\n\t\tcolor:'#999',\n\t\ttextAlign:'center',\n\t\twidth:'auto',\n\t\theight:'auto'\n\t});\n\n\twin.add(label);\n\n\tfunction lineTypeToStr()\n\t{\n\t\tvar type = Ti.Media.audioLineType;\n\t\tswitch(type)\n\t\t{\n\t\t\tcase Ti.Media.AUDIO_HEADSET_INOUT:\n\t\t\t\treturn \"headset\";\n\t\t\tcase Ti.Media.AUDIO_RECEIVER_AND_MIC:\n\t\t\t\treturn \"receiver/mic\";\n\t\t\tcase Ti.Media.AUDIO_HEADPHONES_AND_MIC:\n\t\t\t\treturn \"headphones/mic\";\n\t\t\tcase Ti.Media.AUDIO_HEADPHONES:\n\t\t\t\treturn \"headphones\";\n\t\t\tcase Ti.Media.AUDIO_LINEOUT:\n\t\t\t\treturn \"lineout\";\n\t\t\tcase Ti.Media.AUDIO_SPEAKER:\n\t\t\t\treturn \"speaker\";\n\t\t\tcase Ti.Media.AUDIO_MICROPHONE:\n\t\t\t\treturn \"microphone\";\n\t\t\tcase Ti.Media.AUDIO_MUTED:\n\t\t\t\treturn \"silence switch on\";\n\t\t\tcase Ti.Media.AUDIO_UNAVAILABLE:\n\t\t\t\treturn \"unavailable\";\n\t\t\tcase Ti.Media.AUDIO_UNKNOWN:\n\t\t\t\treturn \"unknown\";\n\t\t}\n\t}\n\n\tvar linetype = Titanium.UI.createLabel({\n\t\ttext: \"audio line type: \"+lineTypeToStr(),\n\t\tbottom:20,\n\t\tcolor:'#999',\n\t\ttextAlign:'center',\n\t\twidth:'auto',\n\t\theight:'auto'\n\t});\n\n\twin.add(linetype);\n\n\tvar volume = Titanium.UI.createLabel({\n\t\ttext: \"volume: \"+Ti.Media.volume,\n\t\tbottom:50,\n\t\tcolor:'#999',\n\t\ttextAlign:'center',\n\t\twidth:'auto',\n\t\theight:'auto'\n\t});\n\n\twin.add(volume);\n\n\tTi.Media.addEventListener('linechange',function(e)\n\t{\n\t\tlinetype.text = \"audio line type: \"+lineTypeToStr();\n\t});\n\n\tTi.Media.addEventListener('volume',function(e)\n\t{\n\t\tvolume.text = \"volume: \"+e.volume;\n\t});\n\n\tvar duration = 0;\n\n\tfunction showLevels()\n\t{\n\t\tvar peak = Ti.Media.peakMicrophonePower;\n\t\tvar avg = Ti.Media.averageMicrophonePower;\n\t\tduration++;\n\t\tlabel.text = 'duration: '+duration+' seconds\\npeak power: '+peak+'\\navg power: '+avg;\n\t}\n\n\tvar b1 = Titanium.UI.createButton({\n\t\ttitle:'Start Recording',\n\t\twidth:200,\n\t\theight:40,\n\t\ttop:20\n\t});\n\tb1.addEventListener('click', function()\n\t{\n\t\tif (recording.recording)\n\t\t{\n\t\t\tfile = recording.stop();\n\t\t\tb1.title = \"Start Recording\";\n\t\t\tb2.show();\n\t\t\tpause.hide();\n\t\t\tclearInterval(timer);\n\t\t\tTi.Media.stopMicrophoneMonitor();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!Ti.Media.canRecord) {\n\t\t\t\tTi.UI.createAlertDialog({\n\t\t\t\t\ttitle:'Error!',\n\t\t\t\t\tmessage:'No audio recording hardware is currently connected.'\n\t\t\t\t}).show();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tb1.title = \"Stop Recording\";\n\t\t\trecording.start();\n\t\t\tb2.hide();\n\t\t\tpause.show();\n\t\t\tTi.Media.startMicrophoneMonitor();\n\t\t\tduration = 0;\n\t\t\ttimer = setInterval(showLevels,1000);\n\t\t}\n\t});\n\twin.add(b1);\n\n\tvar pause = Titanium.UI.createButton({\n\t\ttitle:'Pause recording',\n\t\twidth:200,\n\t\theight:40,\n\t\ttop:80\n\t});\n\twin.add(pause);\n\tpause.hide();\n\n\tpause.addEventListener('click', function() {\n\t\tif (recording.paused) {\n\t\t\tpause.title = 'Pause recording';\n\t\t\trecording.resume();\n\t\t\ttimer = setInterval(showLevels,1000);\n\t\t}\n\t\telse {\n\t\t\tpause.title = 'Unpause recording';\n\t\t\trecording.pause();\n\t\t\tclearInterval(timer);\n\t\t}\n\t});\n\n\tvar b2 = Titanium.UI.createButton({\n\t\ttitle:'Playback Recording',\n\t\twidth:200,\n\t\theight:40,\n\t\ttop:80\n\t});\n\n\twin.add(b2);\n\tb2.hide();\n\tb2.addEventListener('click', function()\n\t{\n\t\tif (sound && sound.playing)\n\t\t{\n\t\t\tsound.stop();\n\t\t\tsound.release();\n\t\t\tsound = null;\n\t\t\tb2.title = 'Playback Recording';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tTi.API.info(\"recording file size: \"+file.size);\n\t\t\tsound = Titanium.Media.createSound({url:file});\n\t\t\tsound.addEventListener('complete', function()\n\t\t\t{\n\t\t\t\tb2.title = 'Playback Recording';\n\t\t\t});\n\t\t\tsound.play();\n\t\t\tb2.title = 'Stop Playback';\n\t\t}\n\t});\n\n\tvar switchLabel = Titanium.UI.createLabel({\n\t\ttext:'Hi-fidelity:',\n\t\twidth:'auto',\n\t\theight:'auto',\n\t\ttextAlign:'center',\n\t\tcolor:'#999',\n\t\tbottom:115\n\t});\n\tvar switcher = Titanium.UI.createSwitch({\n\t\tvalue:false,\n\t\tbottom:80\n\t});\n\n\tswitcher.addEventListener('change',function(e)\n\t{\n\t\tif (!switcher.value)\n\t\t{\n\t\t\trecording.compression = Ti.Media.AUDIO_FORMAT_ULAW;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trecording.compression = Ti.Media.AUDIO_FORMAT_LINEAR_PCM;\n\t\t}\n\t});\n\twin.add(switchLabel);\n\twin.add(switcher);\n}\n\nwin.open();\n{code}", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-30T23:05:50.000+0000", "updated": "2013-08-30T23:05:50.000+0000" }, { "id": "269171", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/4635\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4634", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-30T23:10:30.000+0000", "updated": "2013-08-30T23:10:30.000+0000" }, { "id": "269179", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR's merged", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-30T23:25:19.000+0000", "updated": "2013-08-30T23:25:19.000+0000" }, { "id": "270693", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Doc PR's\nmaster - https://github.com/appcelerator/titanium_mobile/pull/4671\n3_1_X - https://github.com/appcelerator/titanium_mobile/pull/4672", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-09-10T22:32:48.000+0000", "updated": "2013-09-10T22:32:48.000+0000" }, { "id": "271121", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested the above code with:\r\nAppcelerator Studio, build: 3.1.3.201309132456\r\nTitanium SDK, build:3.1.3.v20130912171547\r\nMac OS 10.8.4\r\nXcode 5 \r\nCLI: 3.1.2\r\nAlloy: 1.2.2-beta\r\nDevices:\r\niPad3 iOS7 GM seed\r\niPhone5 iOS7 GM seed\r\n\r\nVerified the request to access the microphone, voice recording and playback.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-13T22:01:54.000+0000", "updated": "2013-09-13T22:06:33.000+0000" }, { "id": "271123", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "reopened to correct comment", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-13T22:05:55.000+0000", "updated": "2013-09-13T22:05:55.000+0000" }, { "id": "271124", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed and working as expected.\n\nTiSDK 3.1.3.v20130913121549 \nCLI 3.1.2 GA\nTiStudio 3.1.3.201309132456\nTested on iPad Mini iOS7\n\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-13T22:06:56.000+0000", "updated": "2013-09-13T22:06:56.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }