Web Audio API no sound playing

孤街浪徒 提交于 2019-12-01 07:14:19

问题


I'm trying to get into the Web Audio API as I'm looking to make some visualizations based on the music that's playing. However all examples I have found, it's like the audio is muted. It plays the file but there's no sound.

For example: codepen.io/noeldelgado/pen/jqibm

Even following this - https://www.youtube.com/watch?v=IBHpSkGZtNM yields same result.

I'm on mac, using the latest version of Chrome (42.0.2311.90), have also tried on latest Firefox and it's the same problem.


回答1:


It's a cross-origin access issue in createMediaElementSource that landed in Chrome 42. You need to setup the appropriate headers for the ogg files and set the crossOrigin attribute. Otherwise you get no audio output at all.



来源:https://stackoverflow.com/questions/29708513/web-audio-api-no-sound-playing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!