{ "id": "170123", "key": "AC-5309", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-10-25T20:02:58.000+0000", "created": "2017-10-25T06:31:20.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2017-10-25T20:02:58.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": "Hi guys,\r\nI'm facing a problem.\r\nWhen user taps and holds button(touchstart event), audioRecorder starts recording, when user untap button(touchend event), recording stops and audioPlayer should play that recording.\r\nProblem is, that it's playing fine, but audioPlayer's complete event never fires and whole app will freeze and crash. It happens with Ti.Media.audioPlayer and Ti.Media.Sound on android\r\nCan you please look at it?\r\nThanks", "attachment": [], "flagged": false, "summary": "Android: Ti.Media.AudioPlayer/AudioRecorder", "creator": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "subtasks": [], "reporter": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "environment": "Ti.SDK 6.2.2\r\nmacOS Sierra\r\nNexus 5X Android 7.1", "comment": { "comments": [ { "id": "429547", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~max87],\r\n\r\nThanks for sharing with us. Can you please share a sample test case to reproduce this on our end?\r\n\r\nBest", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-10-25T08:28:01.000+0000", "updated": "2017-10-25T08:28:17.000+0000" }, { "id": "429548", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi @Mostafizur,\r\ntry this, basic code:\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow();\r\nvar recordButton = Ti.UI.createButton({\r\n\ttitle:\"Record\",\r\n\tleft:10\r\n});\r\nwin.add(recordButton);\r\nvar playButton = Ti.UI.createButton({\r\n\ttitle:\"Play\",\r\n\tright:10\r\n});\r\nwin.add(playButton);\r\nvar audioRecorder = Ti.Media.createAudioRecorder();\r\nvar record;\r\nvar audioPlayer = Ti.Media.createAudioPlayer();\r\nvar player = Ti.Media.createSound();\r\nrecordButton.addEventListener(\"touchstart\", function()\r\n{\r\n\t\tif(!Ti.Media.hasAudioRecorderPermissions)\r\n\t\t{\r\n\t\t\tTi.Media.requestAudioRecorderPermissions();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\taudioRecorder.start();\r\n\t\t}\r\n});\r\nrecordButton.addEventListener(\"touchend\", function(e)\r\n{\r\n\trecord = audioRecorder.stop();\r\n\tplayer.setUrl(record.getNativePath());\r\n\tplayer.setVolume(1);\r\n});\r\nplayButton.addEventListener(\"click\", function()\r\n{\r\n\tplayer.play();\r\n});\r\nplayer.addEventListener(\"change\",function(e)\r\n\t{\r\n\t\tTi.API.log(e.description);\r\n\t});\r\n\tplayer.addEventListener(\"error\",function(e)\r\n\t{\r\n\t\tTi.API.log(e.error);\r\n\t});\r\n\tplayer.addEventListener(\"complete\",function(e)\r\n\t{\r\n\t\tTi.API.log(e.success); //never fires, app crashes\r\n\t});\r\n\tplayer.addEventListener(\"progress\",function(e)\r\n\t{\r\n\t\tvar duration = Ti.App.Properties.getString(\"duration\");\r\n\t\t\r\n\t\tTi.API.log(\"progress: \"+e.progress+\" / \"+duration);\r\n\t\tif(e.progress == parseInt(duration)) //never get true to stop playing\r\n\t\t{\r\n\t\t\tplayer.stop();\r\n\t\t\tTi.API.log(\"player.stop()\");\r\n\t\t}\r\n\t});\r\n\r\n{code}\r\n", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2017-10-25T08:39:31.000+0000", "updated": "2017-10-25T08:41:15.000+0000" }, { "id": "429556", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~max87], Thanks for your feedback. We are investigating the issue. In the meantime can you please test the sample code from [here|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.AudioRecorder] and let us know how it goes.", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-10-25T10:55:44.000+0000", "updated": "2017-10-25T10:55:44.000+0000" }, { "id": "429580", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi @Mostafizur\r\nof course I tried to implement code from docs...\r\nI realized, that rebooting my phone helped and now it's playing correctly(damn you, android :) ).\r\nI had some minor problems with recorder too, but I figured it out...\r\nAnyway, thanks for your help and have a nice day", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2017-10-25T19:51:34.000+0000", "updated": "2017-10-25T19:51:34.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }