Audio reports wrong duration and bad seeking

Bugs will be moved here once resolved.

Post » Thu Aug 04, 2016 4:18 am

Problem Description
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
http://faulknermano.com/pub/c2/sound_music_bug_2016_08_04.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.

Observed Result
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.

Expected Result
-Audio should report actual audio file duration in debugger.
-When 'seeking' to a playback position, the seeking should be the same as other platforms.


Affected Browsers
  • Chrome: (YES) (Android ONLY)
  • FireFox: (NO)

Operating System and Service Pack
Windows 7 SP1

Construct 2 Version ID
r232
B
42
S
12
G
1
Posts: 74
Reputation: 2,992

Post » Mon Aug 08, 2016 11:13 am

The fact this happens only on Chrome for Android strongly indicates a problem with Chrome and not Construct 2's code, but I will leave this open for investigation later.
Scirra Founder
B
402
S
238
G
89
Posts: 24,632
Reputation: 196,031

Post » Wed Aug 31, 2016 2:49 pm

I can't reproduce any issue in Chrome for Android (currently v52) - the debugger is fiddly on mobile so I just added a text object showing the duration and playback time (.capx: https://dl.dropboxusercontent.com/u/15217362/sound_music_bug_2016_08_31.capx) and it displays the correct duration and playback position.

I know that Google have been doing some heavy work on the audio engine in Chrome for Android recently, and v52 made some big changes, so maybe check your Chrome is up to date and try again. If not try Chrome Dev for Android which is newer. I think you were seeing a problem on an older version that was subsequently fixed, so closing this report.
Scirra Founder
B
402
S
238
G
89
Posts: 24,632
Reputation: 196,031


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest