문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top