{ "id": "170815", "key": "TIMOB-25682", "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": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2018-01-21T08:26:51.000+0000", "created": "2018-01-17T18:49:39.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:52:07.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": [], "description": "We are building an app wherein audio recording and playing audio files is a requirement.\r\nThe problem we are facing now is when a music app(Spotify/sound-cloud) is playing an audio while we record audio using app the music app pauses the audio but when recording is stopped the music app audio is not resumed.\r\n\r\nwe have tried all sessionCategories but none of these works.\r\nAUDIO_SESSION_CATEGORY_AMBIENT\r\nAUDIO_SESSION_CATEGORY_PLAYBACK\r\nAUDIO_SESSION_CATEGORY_PLAY_AND_RECORD\r\nAUDIO_SESSION_CATEGORY_RECORD\r\nAUDIO_SESSION_CATEGORY_SOLO_AMBIENT", "attachment": [], "flagged": false, "summary": "iOS: Ti.Media.audioSessionCategory not working correctly for an audioRecorder app.", "creator": { "name": "jvega2k", "key": "jvega2k", "displayName": "Jose", "active": true, "timeZone": "America/Bogota" }, "subtasks": [], "reporter": { "name": "jvega2k", "key": "jvega2k", "displayName": "Jose", "active": true, "timeZone": "America/Bogota" }, "environment": null, "closedSprints": [ { "id": 990, "state": "closed", "name": "2018 Sprint 02 SDK", "startDate": "2018-01-14T22:48:43.544Z", "endDate": "2018-01-28T22:48:00.000Z", "completeDate": "2018-01-29T16:22:42.911Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "433270", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Do you have an example of this behavior? Maybe a simplified test-case that we can reproduce? We did much refactoring on the AudioRecorder API recently, so it may be possible that we missed something. Thanks!\r\n\r\n*EDIT*: Some background: We added precompiler-statements to compile out APIs that the developer does not actually use. For the AudioRecorder, all audio-session APIs should be available though. So constants like {{Ti.Media.AUDIO_SESSION_CATEGORY_AMBIENT}} should return a value. Also, (until you provide the test-case), how did you set the audio-session category? Since Titanium SDK 7, it's recommended to use {{Ti.Media.setAudioSessionCategory()}}\r\n\r\n*EDIT 2*: Can you confirm this does not happen on Titanium SDK 6.x ? We definitely need a test-case to continue. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-17T20:24:16.000+0000", "updated": "2018-01-20T09:00:16.000+0000" }, { "id": "433329", "author": { "name": "jvega2k", "key": "jvega2k", "displayName": "Jose", "active": true, "timeZone": "America/Bogota" }, "body": "We definitely need a test-case to continue. Thanks!\r\n\r\n--- this happens in both 6.x and 7.0.0 and 7.0.1\r\n\r\n------------------------\r\ntest-case:\r\n------------------------\r\n\r\nvar window = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar recordStart = Ti.UI.createButton({\r\n title: 'Start',\r\n top: 30\r\n});\r\n\r\nvar recordPause = Ti.UI.createButton({\r\n title: 'Pause',\r\n top: 90\r\n});\r\n\r\nvar recordStop = Ti.UI.createButton({\r\n title: 'Stop',\r\n top: 140\r\n});\r\n\r\nvar recordPlay = Ti.UI.createButton({\r\n title: 'Play',\r\n top: 190\r\n});\r\nTi.Media.setAudioSessionCategory(Ti.Media.AUDIO_SESSION_CATEGORY_RECORD);\r\nvar audioRecorder = Ti.Media.createAudioRecorder();\r\naudioRecorder.format = Ti.Media.AUDIO_FILEFORMAT_WAVE;\r\nvar record;\r\nvar audioPlayer;\r\n\r\nwindow.addEventListener('open', function(e) {\r\n if (!Ti.Media.hasAudioRecorderPermissions()) {\r\n Ti.Media.requestAudioRecorderPermissions(function(e) {\r\n if (e.success) {\r\n window.add(recordStart);\r\n }\r\n });\r\n } else {\r\n window.add(recordStart);\r\n }\r\n});\r\n\r\nrecordStart.addEventListener('click', function(e) {\r\n audioRecorder.start();\r\n});\r\n\r\nrecordPause.addEventListener('click', function(e) {\r\n if (audioRecorder.getPaused()) {\r\n recordPause.setTitle('Pause');\r\n audioRecorder.resume();\r\n } else {\r\n recordPause.setTitle('Resume');\r\n audioRecorder.pause();\r\n }\r\n});\r\n\r\nrecordStop.addEventListener('click', function(e) {\r\n record = audioRecorder.stop();\r\n Ti.API.info(\"====record \"+record);\r\n Ti.API.info(\"====record file \"+record.getNativePath());\r\n});\r\n\r\nrecordPlay.addEventListener('click', function(e) {\r\n audioPlayer = Ti.Media.createAudioPlayer({\r\n url: record.getNativePath(),\r\n volume : 1,\r\n allowBackground : true\r\n });\r\n audioPlayer.start();\r\n});\r\n\r\nwindow.add(recordPause);\r\nwindow.add(recordStop);\r\nwindow.add(recordPlay);\r\n\r\nwindow.open();", "updateAuthor": { "name": "jvega2k", "key": "jvega2k", "displayName": "Jose", "active": true, "timeZone": "America/Bogota" }, "created": "2018-01-19T11:16:27.000+0000", "updated": "2018-01-19T11:16:27.000+0000" }, { "id": "433430", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "And did it work with any previous SDK you used? The code looks conspicuous at a few parts, like {{allowBackground}} which is Android only and {{record}} that is handled as a Ti.Blob but is assigned via {{audioRecorder.stop()}} which is void and doesn't return anything.\r\n\r\nSeeing that and knowing that other developers use this API without issues in production, I'll resolve this ticket know as this place is rather for reporting issues with the SDK instead of issues with an own configuration. You can still reach out for help using Stackoverflow or the TiSlack community with > 1500 registered developers waiting to help. And if it turns out that your (fixed) code still is unable to work in the background, let us know and we'll consider to reopen this ticket, thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-21T08:26:38.000+0000", "updated": "2018-01-21T08:26:38.000+0000" }, { "id": "440279", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as \"not our bug\". If you disagree, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:52:07.000+0000", "updated": "2018-08-06T17:52:07.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }