【问题标题】:Aframe audio issueAframe 音频问题
【发布时间】:2018-07-01 21:38:28
【问题描述】:

我在我的场景中包含了以下音频资产。两种方式都试过了....

<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>

【问题讨论】:

  • 可能与this?类似的问题至少值得一试。

标签: aframe


【解决方案1】:

当我使用带有preload: auto 属性的音频标签时,似乎可以正常工作:

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

试试here

【讨论】:

    猜你喜欢
    • 2019-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-23
    • 2022-01-08
    • 2018-07-19
    相关资源
    最近更新 更多