New issue
Advanced search Search tips

Issue 769634 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Audio Loop will stop looping sound by itself after some repeats

Reported by mamek...@googlemail.com, Sep 28 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce the problem:
1. call http://www.oxyd.games/soundtest2.html in Chrome
2. Press "Start Sound"
3. Sound will stop after some repeats, without any other user actions
4. call this site on Firefox, it's working well :-(

What is the expected behavior?
The sound should not stop by itself.

What went wrong?
The sound loop stops.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

I need this option to create looping sounds in my game. It is a basic function and there is no work around available.
 
audiotest.zip
317 KB Download

Comment 1 Deleted

Comment 2 Deleted

Ok, I found the difference: Chrome ever use the duration parameter, Firefox ignores duration parameter at loop sounds. 

I think, this behaivor is wrong and it makes problems by using sound atlases which includes looping sounds.
So, in chrome it is impossible to use sound atlases with looping sounds, only the last sound in a atlas can be a loop sound (with note release) :-(

Comment 5 by rtoy@chromium.org, Sep 28 2017

Status: WontFix (was: Unconfirmed)
Don't know what a sound atlas is, but maybe you start by not specifying a duration for the AudioBufferSource that you're playing?

In any case, this is working as required by the spec (https://webaudio.github.io/web-audio-api/#dom-audiobuffersourcenode-start).  The duration parameter to start limits how long the loop actually plays.

Closing as WAI. If this is incorrect, please re-open or file a new bug.
I think there is a lack in w3c definition. There is no description of the duration-parameter behaivor while a loop sound is playing.

A sound atlas is a collection of multiple sounds inside one audio buffer.

The chrome audio api impelementation makes no sense, because there is no additional parameter to define the end sample of the started sound. Firefox uses the duration-parameter to define the end of the sound.

The only workaround for chrome is currently to extract all loop sounds from the atlas to separate audio buffers. But that is not the idea of using sound atlases :-(

Comment 7 by rtoy@chromium.org, Sep 29 2017

Status: Available (was: WontFix)
For duration, the spec says this:  https://webaudio.github.io/web-audio-api/#dom-audiobuffersourcenode-start.  Pretty much a duration parameter is the same as calling start(now + duration).

And I'm pretty sure this is consistent with the playback algorithm https://webaudio.github.io/web-audio-api/#playback-AudioBufferSourceNode

Can you explain exactly what you think

start(time, offset, duration) should do when you have loop = true, and loopStart and loopEnd set to some value?

Re-opening issue again.
Hi,

W3C: "Setting the loop attribute to true causes playback of the region of the buffer defined by the endpoints loopStart and loopEnd to continue indefinitely,..." (the last word is important)

So, the duration-parameter defines the end sample, not the duration (time) of looping or playing. It is the same as the playbackRate property which is independent of the duration-parameter. Only in this way it is possible to play instrument sounds with sustian and release, independent of playback-rate and looping (especially if there are multiple samples for each note in audio buffer).

And: "Note that the values of the loop endpoints are expressed as time offsets in terms of the sample rate of the buffer, meaning that these values are independent of the node's playbackRate parameter which can vary dynamically during the course of playback."

Regards
Meinolf
I have updated my test case: http://www.oxyd.games/soundtest3.html

Please compare Firefox and Chrome behaivor.

Comment 10 by rtoy@chromium.org, Oct 2 2017

Thanks for the updates.  I think in c#8, the parts you referenced from the spec are bugs in the spec.  I'll file an issue against the spec on that.  I think the description of the duration parameter is the definitive definition of how it works.

And thanks for the update test.  I do hear that Chrome and Firefox produce different sounds for the "Start Laser Loop Sound (1)". I assume you think Firefox is doing the right thing.

Comment 12 by rtoy@chromium.org, Oct 5 2017

Status: WontFix (was: Available)
From the spec issue, Chrome is working as intended.  Specifying a duration implies the loop will eventually stop.  The text will be updated to clarify that loop is stopped if a duration is specified.

A Firefox representative was surprised that duration was not being honored.

Closing as WontFix: WAI.

Please reopen or file a new issue if this is incorrect.

Sign in to add a comment