【发布时间】:2016-01-22 15:39:14
【问题描述】:
我的 js 游戏无法在 IE11 中播放我的音频文件。音频在 chrome 中运行良好。我做错了什么?
我使用 Audition 将 wav 转换为 mp3。它说它正在将它们转换为有损或无损。不知道这意味着什么。
我阅读了这篇类似的帖子,并尝试了一些与我的案例相关的修复,但没有成功。 mp3 audio works in all browsers but not IE9
var assets = [
{ id: "BackGround", src: assetsPath + "sequenceBlackBackground.png" },
{ id: "start_button", src: assetsPath + "SequencePlayButton.png" },
{ id: "clockBack", src: assetsPath + "clockBack.png" },
{ id: "clockHand", src: assetsPath + "clockHand.png" },
{ id: "levelUp", src: assetsPath + "Levelup.jpg" },
{ id: "GameOverIcon", src: assetsPath + "gameovericon.png" },
{ id: "GameOver", src: assetsPath + "GameOver.mp3" },//GameOver.ogg
{ id: "level1_Audio", src: assetsPath + "level1.mp3" },
{ id: "level2_Audio", src: assetsPath + "level1.mp3" },
{ id: "level3_Audio", src: assetsPath + "level3.mp3" },
{ id: "levelup", src: assetsPath + "level-up.mp3" },
{ id: "click", src: assetsPath + "click.mp3" }
];
function playLevelAudioClip() {
if (level == 1) {
createjs.Sound.play("level1_Audio");
} else if (level == 2) {
createjs.Sound.play("level2_Audio");
} else if (level == 3) {
createjs.Sound.play("level3_Audio");
}
}
【问题讨论】:
-
我阅读了那篇文章,但找不到可以使用的解决方案。我在看什么吗?
-
我想是的……它仍然是重复的……我想
-
我重新阅读了这篇文章。我在互联网选项中检查了我的播放音频框。我不知道我在上面的代码中在哪里添加了 preload="auto" 。另一篇文章谈论编辑我的 html 文档,我只是加载我的画布,没有其他代码。还是迷路了。
标签: javascript html mp3 createjs