LibGDX 中声音和音乐类型有什么区别?这在桌面和 Android 上都有效:
Music gameMusic = Gdx.audio.newMusic(Gdx.files.internal("sound/gamemusic.mp3"));
gameMusic.play();:
Sound gameMusic = Gdx.audio.newSound(Gdx.files.internal("sound/gamemusic.mp3"));
gameMusic.play();
最佳答案
音乐被传输,而声音被加载到内存中。 (因为带有 libgdx 的 Android 对“声音”文件的大小有 1mb 的限制,音乐可以更大)
这里是这么说的:
https://github.com/libgdx/libgdx/wiki/Sound-effects
https://github.com/libgdx/libgdx/wiki/Streaming-music
根据 SO 上的另一个问题,加载后必须等待一帧才能直接播放声音: No Sound in Android Application with Libgdx
关于java - LibGDX 声音和音乐类型有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24305630/