Help - Search - Members - Calendar
Full Version: Wav to Flac -> corrupt Wav?
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
zasdarq
Hello,

I'm attempting to encode fairly large WAV files (90 - 800 MB each) to FLAC files using the flactools. The files play fine while in wave format, and I've been able to encode some test waves to flac and play those flac files as well. However, when converting this group of WAV files to FLAC, the FLAC will not open after the encoding. Errors:

Default Player: "An Error Occurred: Could Not Decode Stream"
flac123: "error handler called!" <- repeated over and over and over
VLC: no error, it "plays" but the timer isn't at 00:00:00 the whole time and no sound

There are no errors during the encoding, though there are some warnings.
Here is the output:

flac -f -8 --verify 10_A.wav

10_A.wav: WARNING: skipping unknown sub-chunk 'bext' (use
--keep-foreign-metadata to keep)
10_A.wav: WARNING: legacy WAVE file has format type 1 but bits-per-sample=24
10_A.wav: WARNING: skipping unknown sub-chunk 'minf' (use
--keep-foreign-metadata to keep)
10_A.wav: WARNING: skipping unknown sub-chunk 'elm1' (use
--keep-foreign-metadata to keep)
10_A.wav: 100% complete, ratio=0.62410_A.wav: WARNING: skipping unknown
sub-chunk 'regn' (use --keep-foreign-metadata to keep)
10_A.wav: WARNING: skipping unknown sub-chunk 'ovwf' (use
--keep-foreign-metadata to keep)
10_A.wav: WARNING: skipping unknown sub-chunk 'umid' (use
--keep-foreign-metadata to keep)
10_A.wav: Verify OK, wrote 168060055 bytes, ratio=0.624


Running it with flac -t I receive the following messages:

251_A.wav: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
251_A.wav: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC


As a final random test, I attempted to split one of the wav files using wavsplit. That resulted in the following output/error.

Channels: 1
Samplerate: 96000Hz
Samplebits: 24
Databytes: 269503836

Split Hours Mins Seconds Bytes %
Bad file format

I also attempted to convert the WAVE files to MP3 using lame... the same problem arises where I cannot play the resulting MP3 file but there are no errors during the encoding.

Could this be a problem with the codecs for FLAC? Since I can play other files, I don't believe that's it. My best guess is that something is wrong with the wav files, but I don' know how to go about checking them. Is there an integrity checker app or something? I'm fairly new in the audio format world so I'm lost on most of it.

Thank you for the help! Sorry for the long post, I tried to be as detailed as possible.
Matthew
Nick.C
It seems that whatever application wrote the WAV files included non-standard chunks. As an obscure way of testing the integrity of the data chunk, you could try running the WAV's through lossyWAV - this will at least tell you if the chunks that are there are in a sensible order, i.e. RIFF / fmt / data / <others>.
zasdarq
QUOTE(Nick.C @ Feb 6 2008, 14:24) *

It seems that whatever application wrote the WAV files included non-standard chunks. As an obscure way of testing the integrity of the data chunk, you could try running the WAV's through lossyWAV - this will at least tell you if the chunks that are there are in a sensible order, i.e. RIFF / fmt / data / <others>.


I couldn't get lossyWAV working on my system. But I found a hex editor and opened up the WAV file. The screen shot can be seen here:

[img=http://img139.imageshack.us/img139/9617/screenshot251awavghexnd1.th.png]

From what I can tell, the header is correct (RIFF - 4 bytes - WAVE), and then the fmt chunk (which looks empty?) then the data chunk.

My audio knowledge is light at best, so most of this is still foreign to me though.

And in case this provides more information, here is the hex view of the FLAC file after the encoding.

[img=http://img181.imageshack.us/img181/7417/screenshot251aflacghexxt0.th.png]

That one makes even less sense to me than the WAVE file :-/

Again, I really appreciate any help, advice, or links to where I could learn more!

Thanks,
Matthew
Nick.C
QUOTE(zasdarq @ Feb 6 2008, 20:49) *
I couldn't get lossyWAV working on my system.
To use lossyWAV at default settings, extract the .exe file from the .zip file and place in the same directory as the WAV file.

Start > Run > cmd

then, at the command prompt

<drive where the WAV file is>:
cd <directory where the WAV file is>
lossywav <wavfilename>

And that should do it.

zasdarq
QUOTE(Nick.C @ Feb 6 2008, 14:58) *

QUOTE(zasdarq @ Feb 6 2008, 20:49) *
I couldn't get lossyWAV working on my system.
To use lossyWAV at default settings, extract the .exe file from the .zip file and place in the same directory as the WAV file.

Start > Run > cmd

then, at the command prompt

<drive where the WAV file is>:
cd <directory where the WAV file is>
lossywav <wavfilename>

And that should do it.


I'm in Ubuntu Linux... is there another release that's non-Windows?

Thanks,
Matthew
Nick.C
QUOTE(zasdarq @ Feb 6 2008, 21:03) *
I'm in Ubuntu Linux... is there another release that's non-Windows?
Ah, sorry - there is no Linux variant of lossyWAV at present. When v1.0.0 is released I will include Delphi source which should be able to be compiled for Linux with a few modifications.....
zasdarq
So some research and experimentation I think I found one the problem, but I'm not sure how to go about fixing it.

If I import one of the wav files into Audacity then export them as "16 bit PCM" then they convert and play fine. The files bitrates are currently at 24. If I export them from audacity as a 24 or 32 (anything higher than 16), flac fails on me. With a bitrate of 24, the file is encoded but won't play. With a bitrate of 32, flac says it can't do it.

Questions:
1) I assume converting from 24 bits to 16 bits results in a loss of information, right?
2) Is there a faster way to convert rather than going in and out of audacity.
3) Is there a way to make 24 bit files work with flac?

Thank you again,
Matthew
Nick.C
QUOTE(zasdarq @ Feb 6 2008, 21:51) *
So some research and experimentation I think I found one the problem, but I'm not sure how to go about fixing it.

If I import one of the wav files into Audacity then export them as "16 bit PCM" then they convert and play fine. The files bitrates are currently at 24. If I export them from audacity as a 24 or 32 (anything higher than 16), flac fails on me. With a bitrate of 24, the file is encoded but won't play. With a bitrate of 32, flac says it can't do it.

Questions:
1) I assume converting from 24 bits to 16 bits results in a loss of information, right?
2) Is there a faster way to convert rather than going in and out of audacity.
3) Is there a way to make 24 bit files work with flac?

Thank you again,
Matthew
1) Yes;
2) I'm sorry, I don't know for Linux;
3) There was a problem with FLAC a while ago with 24 bit files (v1.2.0 or v1.2.1, I think - quickly followed by a fixed version 1.2.xb). Have you tried updating your FLAC codec?
jcoalson
flac supports 24bps, the issue may be this:
http://www.hydrogenaudio.org/forums/index....mp;#entry518661


p.s. scratch that, if you ran "flac --verify" any it worked, then the same "flac -t" and it failed then something is wierd. can you host the wave file somewhere?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.