HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: #FatalError on 2013-11-21 18:02:02

Title: problem with convertion
Post by: #FatalError on 2013-11-21 18:02:02
hi i have a problem I want to convert a wav file to FLAC with  output in RAW format, one channel and 8000 kbps i used this code

Quote
sox file.wav -c1 -r8000 -t wav - | sox -t wav - out.raw

i tried to convert the same file with this code and the program vlc, with vlc the output file size is 8 kbts with the sox script is 20 kb
how can i fix it?
Title: problem with convertion
Post by: DVDdoug on 2013-11-21 21:35:08
I don't know what a RAW FLAC is, and I don't use SOX...    Or, are you trying to say your input is RAW?

Where's the FLAC command?

But if you have more details, including the bit depth (i.e. 16-bits), the number of channels (mono or stereo) and the playing time, I can take a guess about which file size seems right.

For an uncompressed file:
File size in bytes = Playing time in seconds x (bit depth/8) x number of channels x sample rate in kHz.
A FLAC file is typically around 60% of that.

(Plus, the header and any tags take a little space, and any embedded images can add quite a bit to the file size.)

Do both of these files play?

That should be 8000kHz, not 8000kbps.  I assume your original file is 8000kHz mono?  And with a WAV file, you shouldn't need the -r8000 or -c1 in your command, because SOX can read that information from the WAV header.

P.S.
If you are not happy with VLC, maybe you can use TAudioConverter (http://sourceforge.net/projects/taudioconverter/) and avoid the command line confusion.
Title: problem with convertion
Post by: saratoga on 2013-11-21 23:22:35
In the last thread asking this question you said you wanted RAW PCM.  In this one you're saying FLAC. 

Which do you actually want?