Java – libgdx gets the duration of the music
•
Java
I tried to get the duration of music in libgdx
I'm not talking about:
getPosition();
What I want is the duration of the music (soon)
thank you
Solution
To be clear about "duration", you mean the total time the music plays without a loop
I don't think libgdx sound API exposes this (the minimum standard sound API across desktop, Android and web is quite low...)
You can get this information from the files you load into the system (for example, if they are wav or MP3 files, there should be an API to query their duration)
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码