javascript播放声音启动太慢
我用它来播放声音:
function playSound(soundfile) {
document.getElementById("dummy").innerHTML =
"<embed src='"+soundfile+"' hidden='true' autostart='true' loop='false' />";
}
开始太慢了!!!
我的目标是当鼠标悬停在缩略图上时以及当我有 10 个缩略图时播放一个简短的“chck”彼此靠近时,我想听到:“chck-chck-chck......”
而不是“....................../......” ......chck......../......chck........./............”
诚然 ,第一名声音文件必须从服务器加载的时间,但是之后呢? 启动仍然很慢。
当然,我想要一个跨浏览器的解决方案。
提前致谢...
I'm using this to play sounds:
function playSound(soundfile) {
document.getElementById("dummy").innerHTML =
"<embed src='"+soundfile+"' hidden='true' autostart='true' loop='false' />";
}
And it is sooo desperatly sloooowwwww to start!!!
My target is to play a short "chck" when the mouse hover a thumbnail, and when I have 10 thumbnails close to eachother, I want to hear: "chck-chck-chck...."
But not "................../.................chck......../.......chck........./.........."
Admitedly the 1st time the sound file have to be loaded from the server, but after?
It is STILL slow to start.
Of course, I would like a cross-browsers solution.
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像任何其他元素一样将
emebed
标记放在页面上,然后使用 JavaScript 播放声音。http://www.phon.ucl.ac.uk/home /mark/audio/play4.htm
Put your
emebed
tag on your page like any other element, then use JavaScript to play the sound.http://www.phon.ucl.ac.uk/home/mark/audio/play4.htm