简体   繁体   中英

Audio file duration without AudioSystem class in Java (GAE)?

There is already a more general answer (Java) at https://stackoverflow.com/questions/3009908/how-do-i-get-a-sound-files-total-time-in-java but unfortunately

java.lang.NoClassDefFoundError: javax.sound.sampled.AudioSystem is a restricted class. Please see the Google App Engine developer's guide for more details.

AudioSystem is not on the Google App Engine JRE Class White List and therefore can't be used. Any other approach?

I have (already uploaded) audio files sitting on Google Cloud Storage (GCS) and I can load them into ByteArrayInputStream but somehow I need to convert them into AudioInputStream to get the audio file duration (and save the duration in the database).

A support ticket for Audio Manipulation API along the lines of the Images service is currently in WontFix status: https://code.google.com/p/googleappengine/issues/detail?id=1947 , so it is unlikely that there will be support for this in near future. Issue was reopened again: https://code.google.com/p/googleappengine/issues/detail?id=6442

The solution at this point would be to work with external Audio APIs that are available as a Service. Maybe a list from ProgrammableWeb on Audio APIs could help.

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