13

I have a compressed file its size is 728 and somehow I know this is an audio file and it lasts 1040 ms

The compressed file structure is straight forward:

It is formed with 14 bytes blocks, each block starts with 0x0C:

0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx 0c xx xx xx xx xx xx xx xx xx xx xx xx xx

(xx) could be any hex number

You can download compressed binary file here:

http://dusijun.files.wordpress.com/2013/02/29-aud-bin.doc (please rename to *.aud )

Or text view in doc format

http://dusijun.files.wordpress.com/2013/02/29-aud.doc

There is no header nor meta information. The number of blocks depends on how long the actual audio is. Audio duration to file size is around 1.42

eg

If file size = 9506 then audio could last for 9506*1.42 = 13580 ms around 13 S

Anyone know what codec it could be?

PS:

The binary file is WeChat (ios) audio file.

REF

1)How can I extract/play .aud files?

http://www.boards.ie/vbulletin/showthread.php?t=2055891600

2) WeChat ios

https://itunes.apple.com/us/app/wechat/id414478124?mt=8

Steven Du
  • 1,681
  • 19
  • 35
  • 2
    Im guessing its a raw PCM format, have you tried putting it through FFMPEG? – Richard J. Ross III Feb 24 '13 at 05:06
  • Nice try, though a raw PCM will not have such frame like structure, and especially each frame has a leading char 0X0c . And if it is a raw PCM then for one second the file size (sampling rate *(bits per sample/8)* 1 s ) would be at least many thousands of bytes rather than 728 bytes in the given example. – Steven Du Feb 24 '13 at 05:46
  • 1
    I didn't flag your question, but I think it's not very good fit for a stack overflow. I would recommend to read FAQ. – Victor Ronin Feb 24 '13 at 23:45
  • 1
    728*8/1.04 = 5600 bits/sec = 700 bytes per second. No fractions, that does hint to some kind of uncompressed format. On the other hand, any uncompressed format below about 32 kbps (=32000 bits/sec) sounds worse than a plain old telefon line... not sure what to make of this. It might actually be offsets into another file that has the actual data? (just guessing) – Hazzit Mar 02 '13 at 02:36

2 Answers2

7

I would suspect it is a speech codec. For example RFC6716 and OPUS. The bit rate for this codec is 8-12 kbit/s for NB speech. The 0x0c fits the SILK configuration for 20ms frame size.

| 0...3 | SILK-only | NB | 10, 20, 40, 60 ms |

The 20ms frame size gives around 14bytes. I tried to save the sample as 29-aud-bin.opus and open it in Firefox, but it lacks that header that other opus files have. A version of the SILK codec is also used by Skype.

Community
  • 1
  • 1
artless noise
  • 21,212
  • 6
  • 68
  • 105
  • 1
    +1 showing some sportsmanship and I think you need atleast 2 upvotes to be eligible for the bounty. @DuSijun can confirm... Good luck! – Jeremy Thompson Mar 03 '13 at 02:50
3

What codec it is? Somehow I know this is an audio file. The binary file is WeChat (ios) audio file.

Giving the downloadable sample file an AUD extension doesn't make sense.

You are most likely to find an AUD file in a program folder for a Westwood video game. A file with an AUD file extension is a Video Game Compressed Audio File.


How do I find a codec?

If you know the name of the codec or its ID (known as a FourCC identifier for video codecs or a WaveFormat identifier for audio codecs), try searching the Internet. You can often go to a codec manufacturer's website to download the most recent version of a codec.

Since your file doesn't have header nor meta information (file magic) you can only rely on the file extension, eg:

http://www-mmsp.ece.mcgill.ca/documents/AudioFormats/AU/AU.html

enter image description here

If I get a file with a .EXE extension and *somehow I know this is really an audio file` I can check the file magic using Winista.

public MimeType GetMimeTypeFromFile(string filePath)
{
    sbyte[] fileData = null;
    using (FileStream srcFile = new FileStream(filePath, FileMode.Open, FileAccess.Read))
    {
        byte[] data = new byte[srcFile.Length];
        srcFile.Read(data, 0, (Int32)srcFile.Length);
        fileData = Winista.Mime.SupportUtil.ToSByteArray(data);
    }

    MimeType oMimeType = GetMimeType(fileData);
    if (oMimeType != null) return oMimeType;

    //We haven't found the file using Magic (eg a text/plain file)
    //so instead use URLMon to try and get the files format
    Winista.MimeDetect.URLMONMimeDetect.urlmonMimeDetect urlmonMimeDetect = new Winista.MimeDetect.URLMONMimeDetect.urlmonMimeDetect();
    string urlmonMimeType = urlmonMimeDetect.GetMimeFromFile(filePath);
    if (!string.IsNullOrEmpty(urlmonMimeType))
    {
        foreach (MimeType mimeType in types)
        {
            if (mimeType.Name == urlmonMimeType)
            {
                return mimeType;
            }
        }
    }

    return oMimeType;
}

Note the code to resort to URLMon to find the MIME type can be found here on msdn - Detect file type

The above method will open the file and detect its real MIME type to know which program to open it with. It does the matching using an Video/Audio MIME Type mapping file in XML format:

<!--
 !   Audio primary type
 ! -->

<mime-type name="audio/basic"
           description="uLaw/AU Audio File">
    <ext>au</ext><ext>snd</ext>
    <magic offset="0" type="byte" value="2e736e64000000"/>
</mime-type>

<mime-type name="audio/midi"
           description="Musical Instrument Digital Interface MIDI-sequention Sound">
    <ext>mid</ext><ext>midi</ext><ext>kar</ext>
    <magic offset="0" value="MThd"/>
</mime-type>

<mime-type name="audio/mpeg"
           description="MPEG Audio Stream, Layer III">
    <ext>mp3</ext><ext>mp2</ext><ext>mpga</ext>
    <magic offset="0" value="ID3"/>
</mime-type>

I tried winamp and Windows Media Classic and both failed to open the file.

Since you dont know the file MIME type and the file extension AUD is clearly wrong, I dont think its possible to detect the codec/program needed to play this file.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321