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).
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.
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.
Well I tried that.
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.
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?
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.
Sorry, 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.
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.
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.
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.