[TIMOB-12284] iOS: Sound player volume is really low, especially on device
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-02-21T20:25:55.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 04 API, 2013 Sprint 04 |
Components | iOS |
Labels | api |
Reporter | Davide Cassenti |
Assignee | Vishal Duggal |
Created | 2013-01-15T02:39:40.000+0000 |
Updated | 2017-07-26T03:31:55.000+0000 |
Description
Problem description
The 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.Steps to reproduce
Just create a Sound player and run the code on a device:
var player = Ti.Media.createSound({
url:"sound.wav",
volume: 1.0
});
player.play();
On the simulator the situation is a bit better, but overall the volume is quite low.
The SoundProxy uses the applications shared audio session which can be configured through the Ti.Media module. There are 4 audio session modes that can be used for playback. Ti.Media.AUDIO_SESSION_MODE_AMBIENT - Sound directed through speakers. Ringer silent mutes volume. Ti.Media.AUDIO_SESSION_MODE_SOLO_AMBIENT - Sound directed through speakers. Ringer silent mutes volume. Ti.Media.AUDIO_SESSION_MODE_PLAYBACK - Sound directed through speakers. Ringer silent ignored. Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD - Sound directed through receiver. Ringer silent ignored. Not recommended for playback. However 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. All these volume settings are of course limited by the volume of the sound file you are trying to play. I 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, set the player.volume=1.0 and set the Ti.Media.appMusicPlayer.volume=1.0. Sample Code below. Replace with your own sound file to see how things work together.
Closing ticket as invalid.