Audio (Web Audio API) reports wrong sound file duration when audio is being played from 'Music' folder (as opposed to 'Sound') in Android Chrome. When used in conjunction with playback 'seek' actions, it causes very inaccurate positioning.
Attach a Capx
Description of Capx
Two Sprite 'buttons'; one plays Audio from 'Sounds' folder, another from 'Music' folder. Note that, in actuality, the audio files are located in the 'Music' folder, but the Audio will still play it even though the Audio 'Play' action specifies to play it from the folder 'Sound'.
The audio is 35 seconds long.
Steps to Reproduce Bug
- Run capx in DEBUG mode in Android Chrome.
- Watch Audio object in debugger.
- Press LEFT sprite (which plays the audio in 'Music' folder). Audio will play. Look at playback time of audio; note it reports 21 (or so) seconds as duration.
- Press LEFT sprite again. This is supposed to advance the audio to the 15 second mark as specified in the event sheet. However, this brings it near the end of the audio clip.
- (If you had allowed audio file to play, debugger will report audio as finished playing (ie '0 playing') early even though audio is still playing back.)
- Restart debugger/preview.
- Press RIGHT sprite (plays the audio in 'Sounds' folder). Audio will play. Look at playback time of audio; note it reports 35 (or so) seconds as duration. This is the correct duration.
- Press RIGHT sprite again. This advanced audio to 15 second mark, and this reflects correctly in the sound and in the debugger.
When audio is played in 'Music' folder, debugger reports wrong duration. When seeking is attempted, the playback position is wrong.
This bug happens only in Android Chrome.
Android Firefox, Windows Chrome, Windows Firefox, Safari reports correct duration and seeks properly.
-Audio should report actual audio file duration in debugger.
-When 'seeking' to a playback position, the seeking should be the same as other platforms.
- Chrome: (YES) (Android ONLY)
- FireFox: (NO)
Operating System and Service Pack
Windows 7 SP1
Construct 2 Version ID