Skip to content

Commit 3b3858c

Browse files
authored
Add a suggestion on looping seamless music (#266)
1 parent 74bd93c commit 3b3858c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

wiki/audio/streaming-music.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ A `Music` instance needs to be disposed if it is no longer needed, to free up re
3737
```java
3838
music.dispose();
3939
```
40+
41+
## Seamless Music
42+
43+
If you have music that needs to loop seamlessly be aware that whilst the MP3 format is compatible across all platforms it has technical limitations preventing fully seamless play (see 'Why cant MP3 files be seamlessly spliced together?' at [LAME Technical FAQ](https://lame.sourceforge.io/tech-FAQ.txt)). The approach to solving this will vary depending on the platforms you need to target:
44+
45+
- For **desktop and web only** the Ogg format may work better as it avoids the gap issue of MP3 and (as a bonus) has higher fidelity for the same bitrates. The format is not supported on iOS however and on Android there will still be some gap due to current limitations of the LibGDX Audio module.
46+
- If targeting **iOS and Android** look at using a third-party cross-platform audio backend [alternative](https://libgdx.com/wiki/audio/audio#alternatives), in particular [gdx-miniaudio](https://github.com/rednblackgames/gdx-miniaudio).
47+
- For **web only** you could also consider streaming pre-looped music directly from your server. Do this by excluding the music from the preload filter and not using the AssetManager. This allows you to loop music for as long as needed, without increasing game load times.

0 commit comments

Comments
 (0)