cuixueying @erwer8363:一般都是用mp3,在打包的时候,会用wav
如果你的项目在网页版本中音效使用mp3格式,但是LayaPlayer中又使用wav格式。建议项目使用配置文件的方式进行加载,这样只用在加载配置文件的地方,增加一次判断是否为LayaPlayer运行环境的,伪代码如下所示:
if(window.conch)
{
...加载 "soundConfig-LayaPlayer.json"
}
else
{
...加载 "soundConfig-json"
}
SoundManager.playSound(soundJson[0].url,1);
....
SoundManager.playSound(soundJson[1].url,1);