VorbisJava icon indicating copy to clipboard operation
VorbisJava copied to clipboard

How do I use this? Does it work for .flac files?

Open dessalines opened this issue 10 years ago • 4 comments

There aren't any unit tests so I can't really see how to use it.

dessalines avatar May 19 '15 15:05 dessalines

You can see some FLAC related tests in https://github.com/Gagravarr/VorbisJava/tree/master/core/src/test/java/org/gagravarr/flac and https://github.com/Gagravarr/VorbisJava/blob/master/tika/src/test/java/org/gagravarr/tika/TestFlacParser.java plus use of it in https://github.com/Gagravarr/VorbisJava/blob/master/tools/src/main/java/org/gagravarr/flac/tools/FlacCommentTool.java - do those not cover what you need to see the FLAC code in use?

Gagravarr avatar May 19 '15 15:05 Gagravarr

Thanks, that's pretty much what I needed. Is there anyway to get the duration of the audio? In milliseconds preferably?

dessalines avatar May 19 '15 15:05 dessalines

It's possible that some encoding tools might store that duration in the metadata, but it isn't standard. If not, you'll have to iterate over all the audio packets to calculate it. The Tika Parser should be doing that already for all the file formats, so look there for the handful of calls you need to make

Gagravarr avatar May 19 '15 15:05 Gagravarr

I didn't see anything in that has to do with duration: https://github.com/Gagravarr/VorbisJava/blob/master/tika/src/test/java/org/gagravarr/tika/TestFlacParser.java

dessalines avatar May 19 '15 16:05 dessalines