-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio: Add missing sign in pause(). #18676
Conversation
Updated test fiddle with latest |
That... doesn't look right to me... 🤔 |
I've tested the fiddle quite a while and it seems it's the correct approach to compute the |
@mrdoob @Mugen87
However,
but My mother language isn't English and my understanding of |
Hello All! I noticed this same issue with pausing/restarting looped audio and was working on it in a similar way. Hopefully, mentioning this here is ok as opposed to opening another issue. I was able to make it work properly by changing the line @SUDOCS mentions in the
If r115 |
The property is @shootTheLuck It seems your code does not work if var offset = ( this._pausedAt + this.offset ) % ( this.duration || this.buffer.duration );
source.start( this._startedAt, offset, this.duration ); |
@mugen Awesome! I didn't know about using duration either but I see it now in the docs. I spent yesterday playing with this sound: https://opengameart.org/sites/default/files/audio_preview/54321GO.ogg.mp3 😳 and have a suggestion for pausing with I'd be thrilled to be able to share it in operation and I signed up with jsfiddle but I'm not able to get your fiddle https://jsfiddle.net/4m0c67x8/ to work anymore...nor the one I'm trying to set up here: https://jsfiddle.net/shootTheLuck/cnf14gv9/latest/ . If you'd like to consider them though, my suggestions for |
Can you try it with the following fiddle? https://jsfiddle.net/smhrdac4/ I've only updated the audio file. It's now one of the repository. |
Hi and Thanks! https://jsfiddle.net/shootTheLuck/6jsnLuq2/32/ Hopefully that works to demonstrate |
@SUDOCS I've tested your code and I don't think it works. Why do you think that the computed offset should be modulo the audio buffer's duration? Even if an audio is looped, the duration does not change. |
@Mugen87 Hello, my apologies if I'm mistaken, but did you mean me? Looking back on this, I seem to have been the one to bring up the buffer duration... and you rightly corrected me with:
|
@shootTheLuck Sorry, I was confused by my own suggestion because I've tested with a badly audio file. This one made it much more easier to debug the issue: https://audiojungle.net/item/male-voice-counting-1-to-10/21677488 File #19079 for fixing the issue. |
see #18664. Sorry, I've missed to add the
+
sign 😇 .