michele buzzoni
michele buzzoni

Reputation: 97

How to prevent the libgdx Sound class from restarting the song when using song.loop() in an Android game?

I've added music to my Android game using the libgdx Sound class. However, when I use song.loop(), the song restarts before it finishes playing. How can I prevent this from happening and make the music loop seamlessly?

Thank you for your help!

Upvotes: 0

Views: 241

Answers (1)

lxknvlk
lxknvlk

Reputation: 2850

If your sound file is longer that few seconds you should use the Music class, not the Sound class.

Upvotes: 1

Related Questions