admin管理员组文章数量:1325236
I need quite fast methods for playing sounds/ displaying graphics in a web browser. I came across O3D which does nicely for the 2D graphics aspects but as far as I can tell there is no neat way to play audio from a JavaScript function.
My requirements are that multiply sounds be playable simultaneously and also that each sound start to play quickly (low latency). I'd also like to avoid further plugins if possible. Is this a case of pick any two (out of three)?
Any ideas or suggestions?
I need quite fast methods for playing sounds/ displaying graphics in a web browser. I came across O3D which does nicely for the 2D graphics aspects but as far as I can tell there is no neat way to play audio from a JavaScript function.
My requirements are that multiply sounds be playable simultaneously and also that each sound start to play quickly (low latency). I'd also like to avoid further plugins if possible. Is this a case of pick any two (out of three)?
Any ideas or suggestions?
Share Improve this question asked Jul 11, 2009 at 23:23 PythonPowerPythonPower 1- Possible duplicate: stackoverflow./questions/187098/… – Anderson Green Commented Feb 22, 2013 at 19:11
3 Answers
Reset to default 4So far I don't know anything better than SoundManager. Basically it's Flash wrapper that exposes audio player functionality to JavaScript
This page might be of interest to you:
"Demonstration of Different Ways to Play a Sound from a Web Page"
It covers this:
- Normal Hyperlink to a Sound File
- Embedding a Sound File
- Controlling an Embedded Sound using JavaScript (New)
- Using a Background Sound and JavaScript
- Using Dynamic HTML
- Using a Java Applet
- Using a Java Applet called from JavaScript
- Increasing patibility with Real Player
It doesn't cover Flash, and you don't seem to want to use it. However, nowadays flash has a large install base. It's not unreasonable to ask visitors to have flash installed if you're going to do advanced audio stuff on your page. Flash works properly on almost every OS and browser that you can think of (unlike silverlight), so I'd definitely consider using it.
The Man In Blue (A JavaScript guru) wanted to play with sound on the web with fine control over short sounds (like one might have in a game).
He blogged about it here, and created a demo JavaScript Drum Machine based on it.
That said, if you really want great control, check out SoundManager 2, it provides a fairly robust API.
本文标签: javascriptPlaying Audio In BrowserStack Overflow
版权声明:本文标题:javascript - Playing Audio In Browser - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742167779a2426148.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论