补充一下文档链接: —————— https://developers.weixin.qq.com/minigame/dev/guide/framework/audio/wxAudioQuickStart.html —————— https://docs.unity3d.com/Manual/webgl-audio.html Audio Playback and Browser Security For security reasons, browsers don’t allow audio playback until an end user interacts with your application webpage via a mouse click, touch event or key press. Use a loading screen to allow the end user to interact with your application and start audio playback before your main content begins. —————— FMOD - Platform Details | HTML5 (user interaction requirement) User interaction requirementMost browsers have a user interaction requirement, or audio will not be audible. This was implemented to stop unscrupulous websites from auto playing audio in things like advertisements. FMOD output will become audible upon detecting a user interaction.
小游戏中,用户未交互时不会播放声音背景情况: Unity WebGL项目通过使用“微信小游戏团结/Unity适配方案”转换为微信小游戏项目,音频部分通过FMOD管理。 根据Unity WebGL官方文档以及FMOD官方文档,均表明了需要用户交互后才会播放声音,不交互则不播放声音。 根据观察,很多微信小游戏似乎都没有这种限制,进入小游戏后都是可以在无交互的前提下开始播放声音的。 那么具体绕开这个限制的方式是什么呢?
06-12