Audacity Win 2.1.3: Fixing broken .wav files

Help for Audacity 2.x.x on Windows.

ImageThis forum is for Audacity 2.x.x on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.

Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by Annabelle3985 » Mon Mar 19, 2018 12:49 am

I found something interesting on the Internet, about how to fix broken .wav files that won't open in any players. Someone named Scott Hanselman said something about using a binary file editor, specifically a Hex editor, to fix the headers. However, I'm not sure where I can find any good Hex editors that would work with JAWS. Anybody have any pointers? I've tried Notepad++, but all I get when I read the file line-by-line is a bunch of weird code. Here's an example of a .wav file that I've recently recovered with ICare Data Recovery Pro, but when I import it into Audacity as Raw data, unfortunately I get nothing but very loud static. What do I do next? When I import it into Audacity, it seems to want to say the file was encoded in PCM, 16 Bit, 44Khz, Big Endian. What's "Big Endian"? A teacher of mine, Ed McManus, who works at the Music Technologies department at Lane Community College in Eugene, Oregon, told me that Hex editors are usually sight-oriented, in other words, I would have to have sighted help to fix the headers of a file that is presumably corrupted!
Annabelle3985
 
Posts: 61
Joined: Sat Oct 24, 2015 1:17 am
Operating System: Windows 7

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by steve » Mon Mar 19, 2018 1:49 am

If importing RAW just produces static, then it's probably not only the headers that are wrong.
The first thing that you need to know in order to fix a WAV file, is what the format is. If you don't know what the format is, then you don't know what headers are required.

Sometimes you may know what the format is because you know where the file came from - for example, if it was ripped from a CD and you know for sure that it was ripped as WAV (and not MP3 or any other format), then it is probably "signed 16-bit PCM WAV" with a sample rate of 44100 Hz. When you know what the format is, then you can import it into Audacity using RAW import. If you know the format but it still imports as trash, then the file is too badly damaged to be recovered.

If youdon't know exactly what the format is, but you are certain that it is PCM WAV, then you may be able to determine the format by trial and error with RAW import settings.

If you succeed in importing as RAW, then you can export as a WAV file and Audacity will add the correct headers for you - no need to manually edit the headers.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46549
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by Annabelle3985 » Mon Mar 19, 2018 2:28 am

steve wrote:If importing RAW just produces static, then it's probably not only the headers that are wrong.
The first thing that you need to know in order to fix a WAV file, is what the format is. If you don't know what the format is, then you don't know what headers are required.

Sometimes you may know what the format is because you know where the file came from - for example, if it was ripped from a CD and you know for sure that it was ripped as WAV (and not MP3 or any other format), then it is probably "signed 16-bit PCM WAV" with a sample rate of 44100 Hz. When you know what the format is, then you can import it into Audacity using RAW import. If you know the format but it still imports as trash, then the file is too badly damaged to be recovered.

If youdon't know exactly what the format is, but you are certain that it is PCM WAV, then you may be able to determine the format by trial and error with RAW import settings.

If you succeed in importing as RAW, then you can export as a WAV file and Audacity will add the correct headers for you - no need to manually edit the headers.


I recorded it originally with Sonar 8.5 Producer Edition 64 bit, at a bit depth of 24 bit, PCM, and a sampling rate of 44.1KHZ. From what I understand, Sonar usually saves .wav files as Riff Wave.
Annabelle3985
 
Posts: 61
Joined: Sat Oct 24, 2015 1:17 am
Operating System: Windows 7

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by steve » Mon Mar 19, 2018 2:37 am

Try importing as RAW, 24-bit, 44100 Hz sample rate.
Try each of the Endian settings.
Do you know how many channels it had (mono or stereo)?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46549
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by Annabelle3985 » Mon Mar 19, 2018 4:26 am

steve wrote:Try importing as RAW, 24-bit, 44100 Hz sample rate.
Try each of the Endian settings.
Do you know how many channels it had (mono or stereo)?

I've tried 24 Bit, 44 KHZ, Little Endian, Mono, and I get static. I tried 24 Bit, 44 KHZ, Little Endian, Stereo, still static. Same thing with Big Endian. I even tried changing the offset to 1 or 2 bites, and I get a combination of static with scrambled audio. What do I do next?
Annabelle3985
 
Posts: 61
Joined: Sat Oct 24, 2015 1:17 am
Operating System: Windows 7

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by steve » Mon Mar 19, 2018 1:03 pm

It's not looking very hopeful. Which settings give you "scrambled audio"?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46549
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by DVDdoug » Mon Mar 19, 2018 5:27 pm

Here's an example of a .wav file that I've recently recovered with ICare Data Recovery Pro,
If you intended to attach a file or give a link, it's missing from your post.

It's also possible for the data recovery tool to do more damage. So you might try reading raw audio from the original and the recovered file.

Is the file size about right? For example 24-bits is 3 bytes, so that's 3 x 44,100 for each second of audio. Double that for stereo.

...specifically a Hex editor, to fix the headers. However, I'm not sure where I can find any good Hex editors that would work with JAWS.
I can't help you with that, but it wouldn't be that helpful anyway... In order to reconstruct the header you'd need the same information as you need to open the file as raw data. If something is wrong with the header, the easiest thing to do is open the file as raw and then re-export as WAV (after guessing all of the correct parameters).

Big Endian. What's "Big Endian"?
It's the byte-order. (24-bit data has 3 bytes per sample.) The data in a WAV file is normally little-endian. That means the data is "backwards" with the least significant byte first. (But the samples are in the correct order, so the 1st 3 bytes represent the 1st sample.)

The audio data in a WAV file is just an array of bytes, so if you don't start at the right place (offset) or you get the byte-order wrong, or if you get the bit-depth (number of bytes per sample) wrong, the sound will be scrambled. If you guess the sample rate wrong, it will simply play at the wrong speed. Or, if the offset is wrong the left & right channels can get mixed-up (not so bad). With 24-bits (3 bytes) an offset of 0, 1, or 2, should work (although the left & right in a stereo file could be mixed up). Then the pattern just repeats after that. Except if there's a header it will get read as audio and you'll hear a short glitch at the beginning (which can be edited out). The header is supposed to be 44 bytes so an offset of 44 would be correct if you had a good WAV file.
DVDdoug
Forum Crew
 
Posts: 3172
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: Audacity Win 2.1.3: Fixing broken .wav files

Permanent link to this post Posted by Annabelle3985 » Wed Mar 28, 2018 5:44 pm

DVDdoug wrote:
Here's an example of a .wav file that I've recently recovered with ICare Data Recovery Pro,
If you intended to attach a file or give a link, it's missing from your post.

It's also possible for the data recovery tool to do more damage. So you might try reading raw audio from the original and the recovered file.

Is the file size about right? For example 24-bits is 3 bytes, so that's 3 x 44,100 for each second of audio. Double that for stereo.

...specifically a Hex editor, to fix the headers. However, I'm not sure where I can find any good Hex editors that would work with JAWS.
I can't help you with that, but it wouldn't be that helpful anyway... In order to reconstruct the header you'd need the same information as you need to open the file as raw data. If something is wrong with the header, the easiest thing to do is open the file as raw and then re-export as WAV (after guessing all of the correct parameters).

Big Endian. What's "Big Endian"?
It's the byte-order. (24-bit data has 3 bytes per sample.) The data in a WAV file is normally little-endian. That means the data is "backwards" with the least significant byte first. (But the samples are in the correct order, so the 1st 3 bytes represent the 1st sample.)

The audio data in a WAV file is just an array of bytes, so if you don't start at the right place (offset) or you get the byte-order wrong, or if you get the bit-depth (number of bytes per sample) wrong, the sound will be scrambled. If you guess the sample rate wrong, it will simply play at the wrong speed. Or, if the offset is wrong the left & right channels can get mixed-up (not so bad). With 24-bits (3 bytes) an offset of 0, 1, or 2, should work (although the left & right in a stereo file could be mixed up). Then the pattern just repeats after that. Except if there's a header it will get read as audio and you'll hear a short glitch at the beginning (which can be edited out). The header is supposed to be 44 bytes so an offset of 44 would be correct if you had a good WAV file.


By "Original", do you mean the "Raw file"? ICare Data Recovery Pro finds both "Lost Files" and "Raw Files". With "Raw Files", however, it's hard to tell what's what, as they all have names like "File 001", instead of the original names like "Drum Overhead (5)". Would I listen with my ears to tell which file is the one I want?
Annabelle3985
 
Posts: 61
Joined: Sat Oct 24, 2015 1:17 am
Operating System: Windows 7


Return to Windows



Who is online

Users browsing this forum: No registered users and 8 guests