LibGDX声音和音乐类型之间有什么区别?

LibGDX声音和音乐类型之间有什么区别?

问题描述:

LibGDX中的声音和音乐类型有什么区别?这在台式机和Android上均有效:

What is difference between Sound and Music types in LibGDX? This worked both on desktop and 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,因此音乐的大小可能会更大)

Music is streamed, while Sound is loaded into memory. (Because Android with libgdx has limit of 1mb file for 'sound', Music can be of greater size)

在这里是这样说的:

https://github.com/libgdx/libgdx/wiki/声音效果

https://github.com/libgdx/libgdx/wiki/Streaming-music

根据关于SO的另一个问题,您必须等待一帧,然后才能在加载后直接播放声音: 使用Libgdx的Android应用程序中没有声音

And according to another question on SO, you must wait a frame before you can play a Sound directly after loading: No Sound in Android Application with Libgdx