Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在缓冲源上设置当前时间_Html_Audio_Web Audio Api - Fatal编程技术网

Html 在缓冲源上设置当前时间

Html 在缓冲源上设置当前时间,html,audio,web-audio-api,Html,Audio,Web Audio Api,在html5元素中,我可以通过简单地更改audio.currentTime的值来设置音频曲目的当前时间,但我不知道如何使用web音频api和缓冲源来实现这一点。我试图更改context.currentTime,但由于它是只读的,所以无法工作 如何在缓冲源上设置当前时间?不能以在元素中查找的方式更改播放缓冲源中的当前时间。您需要关闭当前节点(stop()和disconnect())并创建一个指向同一音频缓冲区的新缓冲源节点,并以适当的偏移量启动它。您不能以在元素中查找的方式更改播放缓冲源中的当前时

在html5元素中,我可以通过简单地更改
audio.currentTime
的值来设置音频曲目的当前时间,但我不知道如何使用web音频api和缓冲源来实现这一点。我试图更改context.currentTime,但由于它是只读的,所以无法工作


如何在缓冲源上设置当前时间?

不能以在元素中查找的方式更改播放缓冲源中的当前时间。您需要关闭当前节点(stop()和disconnect())并创建一个指向同一音频缓冲区的新缓冲源节点,并以适当的偏移量启动它。

您不能以在元素中查找的方式更改播放缓冲源中的当前时间。您需要关闭当前节点(stop()和disconnect())并创建一个指向同一AudioBuffer的新buffersource节点,并使用适当的偏移量启动它