gpt4 book ai didi

android - 使用 Libgdx 在 Android 应用程序中没有声音

转载 作者:太空宇宙 更新时间:2023-11-03 12:19:22 25 4
gpt4 key购买 nike

我正在使用 Libgdx 创建一个 Android 应用程序。如果我在桌面版和模拟器上运行该程序,声音效果很好。

当我在我的安卓手机 (Galaxy S3) 上测试应用程序时,没有声音。除了完全缺失的声音外,其他一切在我的设备上都运行良好。有谁知道这里的问题是什么?

向我索取代码或日志,我愿意为您发布!

问候

下面的例子展示了我播放声音的方式:

import com.badlogic.gdx.audio.Sound;

public class LevelDesigner {

public LevelDesigner() {

Sound mp3Sound = Gdx.audio.newSound(Gdx.files.internal("data/sounds/sound.mp3"));
mp3Sound.loop();
}
}

最佳答案

有时声音播放的帧与加载的帧不同,请尝试等待一帧。或者在另一个类(class)播放。

引用:Sound not playing after Loading

关于android - 使用 Libgdx 在 Android 应用程序中没有声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20905364/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com