Turning a header into a non-header .m4a file

I have some .m4a files that were captured from a broadcast stream. They play with mpd (Open Source Music Play Daemon for * nix), but iTunes won't open them (and also several other music players that should be able to play .m4a files). When I looked at the file in hex and compared it to the .m4a file from iTunes, it turned out that the file from the broadcast stream had no header information.

So, I figured I'd try adding some header information to the file to make sure it makes it playable by other players.

I tried to read the white paper on the .m4a file format to understand how the header is structured, but this is too complicated for me (most of the document is about coding, which is irrelevant). The header seems pretty straightforward, conceptually - I can see 4 character tags, variable length data, and there are supposedly some length codes that allow you to separate them. It doesn't seem to contain any significant data about the actual audio data (like its total length), which makes me hope that I could get by simply copying the header from the .m4a file and appending it to those files without the header.

I cannot, however, manually parse (i.e. reverse engineer) the header to even experiment with it. Can anyone describe how to identify the complete header at the beginning of the .m4a file?

+3


source to share





All Articles