简体   繁体   中英

How can I set a JProgressBar to the duration of an audio file?

I have been searching across the web for resources that could show me how to utilize the JProgressBar in this context. However, these resources do not specify how to get the duration of audio files. Is it even possible to do such a thing?

You didn't specify how exactly you are using the audio file, but you should be able to extract the duration of an audio file using AudioFileFormat:

https://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/AudioFileFormat.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM