简体   繁体   English

Web Audio decodeAudioData iOS上的分块音频

[英]Web Audio decodeAudioData iOS on chunked dash audio

I'm looking into playing chunks of dash-audio (aac, 44100) through a sourceBufferNode. 我正在寻找通过sourceBufferNode播放dash-audio(aac,44100)的大块。 First I get the index byte range buffer which has all the header information. 首先,我得到索引字节范围缓冲区,它具有所有标头信息。 Second I get the chunk Third I concatenate the two buffers It works!!! 其次我得到了块第三我连接两个缓冲区它工作! but only on desktop 但仅限于桌面

On iOS where I'm interested in using this, I get the null error on the decodeAudioData 在我有兴趣使用它的iOS上,我在decodeAudioData上得到null错误

If anyone has any ideas why Safari iOS behaves differently / ideas to get this working I would love to know. 如果有人有任何想法为什么Safari iOS表现不同/想法让这个工作,我很想知道。

EDIT: 编辑:

Here is a repo for the code 这是代码的回购

From the Safari Developer Library at Apple: 来自Apple的Safari开发者库:

Note : On iOS, the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap. 注意 :在iOS上,Web Audio API需要通过显式用户操作触发声音,例如点按。 Calling noteOn() from an onload event will not play sound. 从onload事件调用noteOn()将不会播放声音。

https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/PlayingandSynthesizingSounds/PlayingandSynthesizingSounds.html#//apple_ref/doc/uid/TP40009523-CH6-SW5 https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/PlayingandSynthesizingSounds/PlayingandSynthesizingSounds.html#//apple_ref/doc/uid/TP40009523-CH6-SW5

Safari is a long way behind the actual Web Audio API standard unfortunately so it may not work in your way right now. 不幸的是,Safari远远落后于实际的Web Audio API标准,因此它现在可能无法以您的方式运行。

In reality, you need a touch event to trigger playback of each element, not to trigger requests to schedule playback. 实际上,您需要触摸事件来触发每个元素的播放,而不是触发安排播放的请求。 It is part of a drive to both save battery by not rendering anything until the user commands it. 它是驱动器的一部分,通过在用户命令之前不渲染任何东西来节省电池。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM