Question

In an html5 element I can set the current time of the audio track by simply changing the value of audio.currentTime, but I don't understand how to achieve this using the web audio api and a buffered source. I tried to change context.currentTime but it didn't work because it's read only.

How can I set the current time on a buffered source?

Était-ce utile?

La solution

You can't change the current time in a playing buffersource the way you can seek in an element. You need to shut down the current node (stop() and disconnect()) and create a new buffersource node that points to the same AudioBuffer, and start it with the appropriate offset.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top