Need some tutorial on AudioFormatReader/Writer

hi ppl, is here anyone that have tried to subclass the audio format reader and writer classes to read from compressed audio format (mp3,ogg) ? will that be suitable for the cause ? at the moment i’ve implemented a ogg file reader, but is a bit of a hack, i decode the complete ogg in memory and then i use the internal memory for reading instead of the InputStream in the read() function. this works nicely but obviously isn’t the correct method, on large files decoding the whole file on construction still takes a lot. but how is possible to sync the input buffer read and the decoded chunk read if the size of the decoded chunk is different (or not known) from the number of frames i have to fill ?
mmmh maybe i’m confusing…


Did you ever get anywhere this? I know juce now has a ogg file format, but I’m in need of a mp3 AudioFormatReader/Writer.

Or better yet, one that used Quicktime/DirectX/etc o that it supported all the formats supported by the system.

this post is a bit old, i’ve already implemented ogg encode/decode in a proper way until jules throwed in the possibility of using ogg/vorbis and flac support in the lib directly (we’ve done the same job twice!)… anyway in the same period i’ve started doing an AudioFormatReader wrapper based on libmad for mp3 decoding… but actually i’ve hold that project and isn’t usable anyway. actually i’ve no time to support this, but maybe if a lot of people want this i can continue developing and committing to newer versions of the ejuce project.

Actually I’m pretty much interested in MP3 support, so if you have it in a more finished state I’d jump up/down of joy. If not, I could take your code and finish implementing it? :slight_smile:

mmmh, that was a year ago… after that i reformatted my system quite few times… let me see if i can find what i had

Good thing I saw this topic now. I was about to start my own attempt at MP3 decoding via libmad. I got as far as adding the source to Juce and successfully (and cleanly) building sometime this weekend, but I haven’t touched it since.