I am working on a media player project and I want to rotate an image according to the length of the MP3 file that I am playing, i.e. the image should stop rotating when the song is ended. I want to get the duration of the selected MP3 file so I can time the rotation.
I read this question Get PCM data from an MP3 file in Android but I couldn't see how to read the song duration. How can I do this is there - is any function or methods to get the duration of the file?
Here is the Kotlin version