tags:

views:

183

answers:

3

Does anyone know of a good resource on the Audible Audio (.aa) file spec?

I'm trying to write a program that can use them, if no one knows of a resource, any tips on reverse engineering the spec my self? I opened it up in a Hex editor and poked around, looks like an MP3 but with a ton more header info.

A: 

Hi,

I wanted to find out the same info. Do you know how the .aa file header is made up?

Thanks, Adrian

Adrian Chira
A: 

I think, there is no spec. Have a look at Wikipedia/Audible.com:

quote:

[...]
Audible introduced one of the first digital audio players in 1997.
The following year it published a Web site from which audio files in its
proprietary .aa format could be downloaded. Audible holds a number of patents
in this area.
[...]

summary: proprietary/patents

Johannes Weiß
+1  A: 

Hello,

I have done some research into the Audible header to create a player for my car radio/computer. Basically there is a block of 3700 characters at the beginning of the file that encompasses a number of fields of interest, such as Title, Author, Narrator, etc. I have some limited parsing code in C# to display some of the basic info from the .aa file. as follows:

   private void ParseFields(string fileName)
    {
        string aaHeader;
        string tryDate;
        if (fileName == "") return;

        using (StreamReader sr = new StreamReader(fileName))
        {
            char[] buff = new char[3700];
            sr.Read(buff, 0, buff.Length);
            aaHeader = new string(buff);
        }
        try
        {
            _author = GetParsedItem(aaHeader, "author");
        }
        catch
        {
            _author = "?";
        }
        try
        {
            _title = GetParsedItem(aaHeader, "short_title");
        }
        catch
        {
            _title = "???";
        }
        try
        {
            _narrator = GetParsedItem(aaHeader, "narrator");
        }
        catch
        {
            _narrator = "?";
        }
        try
        {
            _description = GetParsedItem(aaHeader, "description");
        }
        catch
        {
            _description = "???";
        }
        try
        {
            _longDescription = GetParsedItem(aaHeader, "long_description");
        }
        catch
        {
            _longDescription = "";
        }
        try
        {
            tryDate = GetParsedItem(aaHeader, "pubdate");
            if (tryDate != "")
                _pubDate = Convert.ToDateTime(GetParsedItem(aaHeader, "pubdate"));
            else
                _pubDate = DateTime.Today;
        }
        catch
        {
            _pubDate = DateTime.Today; 
        }
    }
    private string GetParsedItem(string buffer, string fieldName)
    {
        if (buffer.Contains(fieldName))
        {
            int pos = buffer.IndexOf(fieldName);
            pos += fieldName.Length;
            int posEnd = buffer.IndexOf('\0',pos);
            //if the value for the field is empty, skip it and look for another
            if (pos == posEnd)
            {
                pos = buffer.IndexOf(fieldName, posEnd);
                pos += fieldName.Length;
                posEnd = buffer.IndexOf('\0', pos);
            }
            return buffer.Substring(pos, posEnd - pos);
        }
        else
            return "(not found - " + fieldName + ")";
    }
Dave Evers