Importing RAW WAV file. Lots of noise

I am trying to import a WAV file via raw.
When I import it regularly I get the settings 48000hz Mono, 32bit float.
When I try to import the same file via RAW it’s filled with noise and truncated (well - actually instead of a 4 hour play back it looks to be an hour at high speed from what I can make out through listing to the noise.

How can I find the correct settings to import a file raw?
And is there a way to scrub out that noise? (I assume the noise goes away if the import settings are correct).


Audacity 2.3.3
MacOS Catalina 10.15.2

I did discover that even through the file when imported normally says 48,000hz
I have to set the raw import at 6,000hz to have it come out the right length. But it still has all that noice in there.
I am sure that little cheat isn’t right.

actually setting it to 6,000hz made it “close” to the right play length. Not quite.

Ok. I think I see the problem. Using a program called MediaInfo, it reports back that the file has a bit depth of 4. Seems the lowest Audacity has is 8. Can this be tweaked somewhere in a preference?

What is the full and complete information about the file from MediaInfo?

Why? What are you trying to achieve?

I did a new sample good file… this is the result

Complete name : /Users/punky/Desktop/20170201114909.wav
Format : Wave
File size : 18.5 KiB
Duration : 768ms
Overall bit rate mode : Constant
Overall bit rate : 197 Kbps

Format : ADPCM
Codec ID : 11
Codec ID/Hint : Intel
Duration : 768ms
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 1 channel
Sampling rate : 48.0 KHz
Bit depth : 4 bits
Stream size : 18.0 KiB (97%)

I’ve got a WAV file that is missing header information or something - corrupt. It was created on the same device as the good file. Exact same “settings”. So I want to import the bad file via raw using the settings that I know are good… problem is - it’s 4bit. I don’t see that as an option.

That looks like “IMA ADPCM” format. Unfortunately, Audacity does not support that format with “Import RAW”.

If you have FFmpeg installed, you may be able to convert the files to normal PCM WAV with something like:

ffmpeg -acodec adpcm_ima_wav -i input-file.raw output-file.wav

Well I tried that.
No Luck
The problem is the file is “corrupt”, missing header data so I think ffmpeg doesn’t know how to deal with it.
I think my best bet is still to import the file as raw but with a 4bit depth instead of 8. Just can’t find 4bit as an option for importing.

ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=‘-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check’ --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
BAD.wav: Invalid data found when processing input

If the header is smashed, there’s no guarantee that the data isn’t corrupted, too. Maybe the header is corrupted because the machine couldn’t make a header that matched the bad data.


“VOX ADPCM” is the only 4-bit format that Audacity’s Import Raw supports, but it’s the wrong encoding.

How do you know that it is only the header data that is corrupt and not the audio data?

Pretty sure it’s just the header data that’s missing.
The frustrating thing… is if I took at a good wav file (same coding etc), adding it the regular way (File > Import > Audio) it loads it in fine and plays it etc.
But when i try to do the same file via raw, it’s messed up.

So it appears all the encoding options available in the Import Audio are not available to the Import Raw function.
Does this make sense?

Let’s try this approach.
I’ve attached a WAV file that can be added just fine into Audacity (File > Import > Audio).
But adding it through File > Import > Raw doesn’t produce the same results.

Maybe someone can see what I am talking about and instruct me on how to import this file via Raw?

I thought\ that a file that can be added via the audio way, could be added via the raw way as well.

You can view and edit the raw data in any file (including the header if any) with a hex editor such as [u]XVI32[/u]. Of course, before you go messing-around with something like that, make a copy of your file and play with the copy. :wink:

[EDIT -]
XVI32 is a Windows-only application. You’d have to find a hex editor for the Mac. But it’s a common programmer’s tool so it should be easy to find one.

Here is the [u]WAV header format[/u] or [u]here[/u] is another reference with some different information…

Looking at GOOD.wav I can see that byte 20 is 11 (hex) which is ‘Intel’s DVI ADPCM’.

I’m not real familiar with ADPCM but it seems odd that there are about 500 bytes of zeros before getting to the audio “data”, and that’s different from the spec. (Normally the WAV header is 44 bytes and then the actual audio data starts.)

You may be able to copy the header from a known-good file into the bad file, but you’ll probably have to change the ‘sample data size’ field, and you’ll have to learn to use the hex editor.

The hex editor shows you the individual bytes in hexadecimal (which uses the digits 0-F instead of 0-9) and it will show the [u]ASCII characters[/u] for any bytes that can be converted to ASCII characters so you should see “RIFF” and “WAVE”, etc. i.e. Every time there is a hex 52 (decimal 82) you’ll see the character “R”. The hex editor doesn’t “know” anything about the format and it will show an “R”, whether the hex 52 represents an alpha-numeric character or something else.

You can convert between hex and decimal using the Windows Calculator in Programmer Mode.

If you test that good file here:
you will see:

Complete name                            : GOOD.wav
Format                                   : Wave
File size                                : 240 KiB
Duration                                 : 10 s 240 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 192 kb/s

Format                                   : ADPCM
Codec ID                                 : 11
Codec ID/Hint                            : Intel
Duration                                 : 10 s 240 ms
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 48.0 kHz
Bit depth                                : 4 bits
Stream size                              : 240 KiB (100%)

Note that the format is ADPCM, ID=11, ID/Hint=Intel. That shows that it is “IMA ADPCM

Now look in the Import Raw “Encoding” options. There is no option for IMA ADPCM. The only ADPCM format supported by Import Raw is “Vox ADPCM”, but these two encoding formats, while sharing some technical similarities, are fundamentally different in multi-respects - they are not cross-compatible.

Thank you.
That was very helpful.
I was actually able to copy the header data over using a hex editor to make it match up with the “good” file (and I used that weblink you provided to double check it).

With that I was able to load the file in to Audacity (not by raw but by the usual method).
Unfortunately there was still lots of noise and stuff gong on, plus with added choppiness…
So I didn’t get any further ahead at the end of the day.

Maybe I need to forget about this file damn it.