I am having some issues with extracting metadata values from audio files i.e Artist, Song name etc.
I have tried using an AudioFormatReader and passing the file into it. The format reader then has a String Array within it called “metadata”, but when I access this, there is only NULL within it.
Is anyone able to give me a guide on how to get this information?
Not all audio formats support meta data. So to help you you might tell us which format you try to read.
From the docs:
A set of metadata values that the reader has pulled out of the stream.
Exactly what these values are depends on the format, so you can check
out the format implementation code to see what kind of stuff they
understand.
Well, if you go by daniel’s suggestion and work the metadata values this way and get empty strings, then I’d assume one two things: the file didn’t have the data you’re looking for or the decoder didn’t understand it.
//Lets assume you loaded an AIFF file:
DBG("Result of file's Apple tag: " + reader->metadataValues[AiffAudioFormat::appleTag]);
To me, it looks like your metadata values object is empty - seems like it needs investigation into the decoder (assuming you know there really is data).
Metadata for wav files in particular is a bit of a black hole. We’ve been looking at using metadata for a new product and tried to find a standard format. Hah! Unless you’re putting it there yourself then be very sceptical about what you can expect to get out. The biggest player in the market is Soundminer and they have their own proprietary, encoded format…