Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Trying to determine codec used in RAW file (Read 6249 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Trying to determine codec used in RAW file

I have some RAW audio files from an on-board recorder from an aircraft.  The radio channel files (communication between pilots and the ground) are supposed to be a linear 16-bit PCM format, however, I've tried loading these files into Sound Forge as RAW and used various settings for 8-bit/16-bit, signed/unsigned, little/big endian but I am not getting anywhere.  Depending on what I use, I can sometimes hear communication between the pilots and also between the pilots and ground.  Both cases are very distorted and there is a lot of background noise.  So, I'm kind of stumped.  I have been able to determine that the sampling rate is 8 kHz when 16-bit is used or 16 kHz when 8-bit is used.  And, I'm pretty sure it is signed.  Does anyone have any ideas on what else I could do?  Is there someone that wants to play around with some samples of the audio?

The other file I have, is from the cockpit area microphone.  They probably use some kind of ADPCM codec.  Could be 3 or 4 bit.  Not sure if G723 or G726 or something like that.  I'm just trying to determine the supposedly simpler radio channel files right now.

Trying to determine codec used in RAW file

Reply #1
This sounds difficult. Do you know if the raw files are mono or stereo?

With ffmpeg you can specify the input format of the raw file:
ffmpeg -f s16le -ar 16000 -ac 1 -i theRawFile.raw outFile.wav

You can try replacing 's16le' with any of these:

Quote
D.A.L. adpcm_4xm            ADPCM 4X Movie
DEA.L. adpcm_adx            SEGA CRI ADX ADPCM
D.A.L. adpcm_afc            ADPCM Nintendo Gamecube AFC
D.A.L. adpcm_ct            ADPCM Creative Technology
D.A.L. adpcm_dtk            ADPCM Nintendo Gamecube DTK
D.A.L. adpcm_ea            ADPCM Electronic Arts
D.A.L. adpcm_ea_maxis_xa    ADPCM Electronic Arts Maxis CDROM XA
D.A.L. adpcm_ea_r1          ADPCM Electronic Arts R1
D.A.L. adpcm_ea_r2          ADPCM Electronic Arts R2
D.A.L. adpcm_ea_r3          ADPCM Electronic Arts R3
D.A.L. adpcm_ea_xas        ADPCM Electronic Arts XAS
DEA.L. adpcm_g722          G.722 ADPCM (decoders: g722 ) (encoders: g722 )
DEA.L. adpcm_g726          G.726 ADPCM (decoders: g726 ) (encoders: g726 )
D.A.L. adpcm_g726le        G.726 ADPCM little-endian (decoders: g726le )
D.A.L. adpcm_ima_amv        ADPCM IMA AMV
D.A.L. adpcm_ima_apc        ADPCM IMA CRYO APC
D.A.L. adpcm_ima_dk3        ADPCM IMA Duck DK3
D.A.L. adpcm_ima_dk4        ADPCM IMA Duck DK4
D.A.L. adpcm_ima_ea_eacs    ADPCM IMA Electronic Arts EACS
D.A.L. adpcm_ima_ea_sead    ADPCM IMA Electronic Arts SEAD
D.A.L. adpcm_ima_iss        ADPCM IMA Funcom ISS
D.A.L. adpcm_ima_oki        ADPCM IMA Dialogic OKI
DEA.L. adpcm_ima_qt        ADPCM IMA QuickTime
D.A.L. adpcm_ima_rad        ADPCM IMA Radical
D.A.L. adpcm_ima_smjpeg    ADPCM IMA Loki SDL MJPEG
DEA.L. adpcm_ima_wav        ADPCM IMA WAV
D.A.L. adpcm_ima_ws        ADPCM IMA Westwood
DEA.L. adpcm_ms            ADPCM Microsoft
D.A.L. adpcm_sbpro_2        ADPCM Sound Blaster Pro 2-bit
D.A.L. adpcm_sbpro_3        ADPCM Sound Blaster Pro 2.6-bit
D.A.L. adpcm_sbpro_4        ADPCM Sound Blaster Pro 4-bit
DEA.L. adpcm_swf            ADPCM Shockwave Flash
D.A.L. adpcm_thp            ADPCM Nintendo Gamecube THP
D.A.L. adpcm_xa            ADPCM CDROM XA
DEA.L. adpcm_yamaha        ADPCM Yamaha
DEA.L. pcm_alaw            PCM A-law / G.711 A-law
D.A..S pcm_bluray          PCM signed 16|20|24-bit big-endian for Blu-ray med
a
D.A..S pcm_dvd              PCM signed 20|24-bit big-endian
DEA..S pcm_f32be            PCM 32-bit floating point big-endian
DEA..S pcm_f32le            PCM 32-bit floating point little-endian
DEA..S pcm_f64be            PCM 64-bit floating point big-endian
DEA..S pcm_f64le            PCM 64-bit floating point little-endian
D.A..S pcm_lxf              PCM signed 20-bit little-endian planar
DEA.L. pcm_mulaw            PCM mu-law / G.711 mu-law
DEA..S pcm_s16be            PCM signed 16-bit big-endian
DEA..S pcm_s16be_planar    PCM signed 16-bit big-endian planar
DEA..S pcm_s16le            PCM signed 16-bit little-endian
DEA..S pcm_s16le_planar    PCM signed 16-bit little-endian planar
DEA..S pcm_s24be            PCM signed 24-bit big-endian
DEA..S pcm_s24daud          PCM D-Cinema audio signed 24-bit
DEA..S pcm_s24le            PCM signed 24-bit little-endian
DEA..S pcm_s24le_planar    PCM signed 24-bit little-endian planar
DEA..S pcm_s32be            PCM signed 32-bit big-endian
DEA..S pcm_s32le            PCM signed 32-bit little-endian
DEA..S pcm_s32le_planar    PCM signed 32-bit little-endian planar
DEA..S pcm_s8              PCM signed 8-bit
DEA..S pcm_s8_planar        PCM signed 8-bit planar
DEA..S pcm_u16be            PCM unsigned 16-bit big-endian
DEA..S pcm_u16le            PCM unsigned 16-bit little-endian
DEA..S pcm_u24be            PCM unsigned 24-bit big-endian
DEA..S pcm_u24le            PCM unsigned 24-bit little-endian
DEA..S pcm_u32be            PCM unsigned 32-bit big-endian
DEA..S pcm_u32le            PCM unsigned 32-bit little-endian
DEA..S pcm_u8              PCM unsigned 8-bit
D.A.L. pcm_zork            PCM Zork


Not sure what the sampling rate would be.

Trying to determine codec used in RAW file

Reply #2
Quote
I have been able to determine that the sampling rate is 8 kHz when 16-bit is used or 16 kHz when 8-bit is used.


So its either 8/16k or 16/8k.  Might want to try and narrow that down.  Extracting just the MSB from each 16 bit pair and playing that at 16k and 8 k might give you a clue.

Trying to determine codec used in RAW file

Reply #3
Thanks for your replies.

saratoga, I'm not sure what extracting the MSB of each 16-bit pair would do for me.  I'll try to get my head wrapped around what that might do for me.

LithosZA, the files are mono.  By loading in the files as RAW (no headers, etc. to worry about), I can tell Sound Forge whether the data in the file is 16-bit/8-bit, signed/unsigned, 8-bit/16-bit, etc.  Also the byte order (endian), in the case where I tell it 16-bit samples.  So, I think using ffmpeg would be similar to what I am trying to do, but I can probably eliminate all the lossy codecs you have at the beginning of list.

Thank you both for your help.  I forgot to mention that I was able to determine that this audio information is surrounded by data headers every 320 samples.  I was able to extract out the audio information from these headers. 

I beginning to suspect there may be some other bits surrounding the audio information.  I've started off down a rabbit hole and am reading the AES3-2003 document, which the audio may or may not conform to.  The information I have on this audio is pretty weak other than I suspect it is PCM, 16-bit.  That's what the header of the original data file told me.  But like I said, it could be PCM 16-bit but surrounded by other bits.

Trying to determine codec used in RAW file

Reply #4
Is this something you could upload?

Trying to determine codec used in RAW file

Reply #5
Is this something you could upload?


Yes, I could upload a small sample.  How big should I make it?  How do I post a link?