Aframe音频问题

时间:2018-06-28 11:38:42

标签: aframe

我在场景中包括了以下音频资产。尝试了两种方式。...

<audio id="hover" src="resources/assets_data/hover.mp3"></audio>

<a-asset-item id="hover" src="resources/assets_data/hover.mp3" response-type="arraybuffer"></a-asset-item>

当我尝试在四个菜单元素中播放此声音时,我将遇到错误...并且悬停声音仅在第一个菜单弯曲图像上播放。...

  

components:sound:warn尚未加载声音。它将播放一次   完成加载

代码:

<a-curvedimage  src="#a" transparent="true" 
                height="0.5" radius="0.9" theta-length="40" rotation="0 240 0" position="0 1.74 -1.4" sound="on: mouseenter; src: #hover" selectable>
        </a-curvedimage>

        <a-curvedimage src="#b" transparent="true" 
                height="0.5" radius="0.9" theta-length="40" rotation="0 190 0" position="0 1.74 -1.4" sound="on: mouseenter; src: #hover" selectable>
        </a-curvedimage>

        <a-curvedimage src="#c" transparent="true" 
                height="0.5" radius="0.9" theta-length="40" rotation="0  130 0" position="0 1.74 -1.4" sound="on: mouseenter; src: #hover" selectable>
        </a-curvedimage>

        <a-curvedimage src="#d" transparent="true" 
                height="0.5" radius="0.9" theta-length="40" rotation="0  80 0" position="0 1.74 -1.4" sound="on: mouseenter; src: #hover" selectable>
        </a-curvedimage>

1 个答案:

答案 0 :(得分:0)

当我将音频标签与preload: auto属性一起使用时,似乎可以正常工作:

<a-assets>
   <audio id="mysound" crossorigin="anonymous" src="...">
</a-assets>

尝试here