【发布时间】:2011-11-06 11:25:59
【问题描述】:
有没有办法测试浏览器在 javascript 中播放 wav 文件的能力
function playSound(myWAVfile)
{
if (soundEmbed)
{
document.body.removeChild(soundEmbed);
}
soundEmbed = document.createElement("embed");
soundEmbed.setAttribute("src", myWAVfile);
soundEmbed.setAttribute("hidden", true);
soundEmbed.setAttribute("autostart", true);
document.body.appendChild(soundEmbed);
}
【问题讨论】:
标签: javascript audio embed