{ "id": "107854", "key": "TIMOB-12284", "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": "15272", "description": "2013 Sprint 04 API", "name": "2013 Sprint 04 API", "archived": true, "released": true, "releaseDate": "2013-02-25" }, { "id": "14814", "description": "2013 Sprint 04", "name": "2013 Sprint 04", "archived": true, "released": true, "releaseDate": "2013-02-25" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-02-21T20:25:55.000+0000", "created": "2013-01-15T02:39:40.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [], "issuelinks": [ { "id": "25981", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "109993", "key": "TIDOC-1038", "fields": { "summary": "APIDoc: iOS: Sound player volume -- setting device volume", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-26T03:31:55.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": "h1. Problem description\r\nThe volume of the sound player, especially on device, is really low; also setting the volume to 1.0 - loudest - does not make it very high. Volume does not depend on the device volume as well.\r\n\r\nh1. Steps to reproduce\r\nJust create a Sound player and run the code on a device:\r\n\r\n{code}\r\nvar player = Ti.Media.createSound({\r\n url:\"sound.wav\",\r\n volume: 1.0\r\n});\r\nplayer.play();\r\n{code}\r\n\r\nOn the simulator the situation is a bit better, but overall the volume is quite low.", "attachment": [], "flagged": false, "summary": "iOS: Sound player volume is really low, especially on device", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "SDK 2.1.4\r\nSDK 3.0.0\r\niOS 6", "comment": { "comments": [ { "id": "239308", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The SoundProxy uses the applications shared audio session which can be configured through the Ti.Media module.\nThere are 4 audio session modes that can be used for playback.\nTi.Media.AUDIO_SESSION_MODE_AMBIENT - Sound directed through speakers. Ringer silent mutes volume.\nTi.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT - Sound directed through speakers. Ringer silent mutes volume.\nTi.Media.AUDIO_SESSION_MODE_PLAYBACK - Sound directed through speakers. Ringer silent ignored.\nTi.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD - Sound directed through receiver. Ringer silent ignored. Not recommended for playback.\n\nHowever the volume of the SoundProxy is not tied to the hardware volume. It is actually a fraction of the current device volume. To change the volume of the device use the Ti.Media.appMusicPlayer and set the volume on that object.\n\nAll these volume settings are of course limited by the volume of the sound file you are trying to play.\n\nI would suggest that you use set the Ti.Media.audioSessionMode property to one of Ti.Media.AUDIO_SESSION_MODE_AMBIENT, Ti.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT, Ti.Media.AUDIO_SESSION_MODE_PLAYBACK,\nset the player.volume=1.0 and set the Ti.Media.appMusicPlayer.volume=1.0.\n\nSample Code below. Replace with your own sound file to see how things work together.\n{code}\nvar win = Ti.UI.createWindow({\n backgroundColor : 'white',\n});\n\nvar modes = [Ti.Media.AUDIO_SESSION_MODE_AMBIENT, Ti.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT, Ti.Media.AUDIO_SESSION_MODE_PLAYBACK,Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD]\n\nvar mode = 0;\nvar view = Ti.UI.createView({\n\tlayout:'vertical',\n\theight:Ti.UI.SIZE\n}) \n\nvar appMusicVolume = Ti.UI.createView({\n\tlayout:'vertical',\n\theight:Ti.UI.SIZE\n})\n\nvar l1 = Ti.UI.createLabel({\n\ttext:'APP MUSIC PLAYER VOLUME'\n})\n\nvar sl1 = Ti.UI.createSlider({\n\tmin:0,\n\tmax:1\n})\n\nvar playerVolume = Ti.UI.createView({\n\tlayout:'vertical',\n\theight:Ti.UI.SIZE\n})\n\nvar l2 = Ti.UI.createLabel({\n\ttext:'PLAYER VOLUME'\n})\n\nvar sl2 = Ti.UI.createSlider({\n\tmin:0,\n\tmax:1\n})\n\nappMusicVolume.add(l1);\nappMusicVolume.add(sl1);\nplayerVolume.add(l2);\nplayerVolume.add(sl2);\n\n\nvar b1 = Ti.UI.createButton({\n\ttitle:'PLAY FILE',\n\ttop:10\n})\n\nvar b2 = Ti.UI.createButton({\n\ttitle:'SET AUDIO SESSION MODE',\n\ttop:10\n})\n\nvar label = Ti.UI.createLabel({\n\ttop:10,\n\ttext:'SESSION MODE'\n})\n\nvar label2 = Ti.UI.createLabel({\n\ttop:10,\n\ttext:'VOLUME'\n})\n\n\nvar getAudioSessionMode = function(){\n\tvar sessionMode = Ti.Media.audioSessionMode;\n\tif (sessionMode == Ti.Media.AUDIO_SESSION_MODE_AMBIENT) {\n\t\tlabel.text = 'SESSION MODE AMBIENT'\n\t}\n\telse if (sessionMode == Ti.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT) {\n\t\tlabel.text = 'SESSION MODE SOLO AMBIENT'\n\t}\n\telse if (sessionMode == Ti.Media.AUDIO_SESSION_MODE_PLAYBACK) {\n\t\tlabel.text = 'SESSION MODE PLAYBACK'\n\t}\n\telse if (sessionMode == Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD) {\n\t\tlabel.text = 'SESSION MODE PLAY AND RECORD'\n\t}\n\telse if (sessionMode == Ti.Media.AUDIO_SESSION_MODE_RECORD) {\n\t\tlabel.text = 'SESSION MODE RECORD'\n\t}\n\telse {\n\t\tlabel.text = 'SESSION MODE UNKNOWN '+sessionMode\n\t}\n}\n\nwin.addEventListener('open',function(){\n\tgetAudioSessionMode();\n\tsl1.value = Ti.Media.appMusicPlayer.volume;\n\tsl2.value = player.volume;\n});\n\nview.add(appMusicVolume);\nview.add(playerVolume);\nview.add(b1);\nview.add(b2);\nview.add(label);\nview.add(label2);\nwin.add(view);\nwin.open();\n\nvar player = Ti.Media.createSound({\n url:\"cricket.wav\",\n volume: 1.0\n});\n\nb1.addEventListener('click',function(){\n\tplayer.play();\n})\n\nb2.addEventListener('click',function(){\n\tmode = mode % modes.length;\n\tplayer.stop();\n\tTi.Media.setAudioSessionMode(modes[mode]);\n\tgetAudioSessionMode();\n\tmode++;\n})\n\nTi.Media.addEventListener('volume',function(e){\n\tlabel2.text = 'VOLUME: '+e.volume;\n\tsl1.value = Ti.Media.appMusicPlayer.volume;\n\tsl2.value = player.volume;\n})\n\nvar sl1Valid = false;\nsl1.addEventListener('touchstart',function(){\n\tsl1Valid = true;\n})\nsl1.addEventListener('touchend',function(){\n\tsl1Valid = false;\n})\nsl1.addEventListener('change',function(e){\n\tif(sl1Valid == true) {\n\t\tTi.Media.appMusicPlayer.volume = e.value;\n\t}\n})\nvar sl2Valid = false;\nsl2.addEventListener('touchstart',function(){\n\tsl2Valid = true;\n})\nsl2.addEventListener('touchend',function(){\n\tsl2Valid = false;\n})\nsl2.addEventListener('change',function(e){\n\tif(sl2Valid == true) {\n\t\tplayer.volume = e.value;\n\t}\n})\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-21T20:25:03.000+0000", "updated": "2013-02-21T20:25:03.000+0000" }, { "id": "424726", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T03:31:55.000+0000", "updated": "2017-07-26T03:31:55.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }