-
Notifications
You must be signed in to change notification settings - Fork 32
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
报错:AudioContext decoding get Wrong:Failed to execute 'decodeAudioData' on 'BaseAudioContext'..... #28
Comments
后端提供的wav接口,是指wav文件访问链接吗?你的wav文件大不大,不大的话可以加载完再生成波形图试试 var wf = new WFPlayer({
container: document.querySelector("#waveform"),
});
fetch("path/to/audio.wav")
.then((res) => res.buffer())
.then((buffer) => new Uint8Array(buffer))
.then((uint8Array) => wf.load(uint8Array)); |
后端提供一个wav文件流,目前是想边加载边生成波形 |
其实很难做到真正的边加载边生成波形的,因为这个库使用浏览器自带的 |
嗯嗯,感谢你的回答 |
@yuguaa 你可以贴这个mp4的地址出来吗,我看看 |
这个地址有公司的信息,不太方便,是mp4格式,没有其他的要求,视频大小大概是400M |
@yuguaa 这视频有点大,音频解码过程都会把浏览器卡死,你可以把视频转成mp3试试,首页有ffmpeg的教程 |
3q,我去看看 |
ffmpeg转码mp3需要的时间会更长~且ffmpeg本身体积有>20mb,光加载ffmpeg就得一分钟~~~ |
我使用在线的测试wav音频文件时可以正常播放、显示波形图;但使用后端提供的wav接口时却报错了,无法生成波形,但等待后可以播放,似乎是audioContext解析不了,但我不知道是哪里有问题; 是否对获取的wav文件有所要求(格式或者大小等...)
The text was updated successfully, but these errors were encountered: