Re: [linux-audio-user] Converting IEEE FLOAT WAV's -- solved

From: Ken Restivo <ken@email-addr-hidden>
Date: Sun Feb 11 2007 - 08:58:28 EET

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Feb 10, 2007 at 07:39:11PM -0800, Ken Restivo wrote:
> I'm having a great deal of difficulty converting WAV formats in 32-bit IEEE FLOAT format, to almost anything else, using command-line tools like sox, flac, and lame.
>
> The only tool I've found so for that can handle IEEE FLOAT WAV's is oggenc. Yay Vorbis. But, the FLAC tools, even though they're from the same developers as Ogg Vorbis, dies horribly, with ERROR: unsupported compression type 3
>
> LAME says it encodes the file, but then listening to the resulting MP3 gives only white/pink noise. I guess it assumes that the file is some other format.
>
> So I figured, I'll use sox to convert it first from 32-bit float to, say, 24 bit linear. No dice: sox loses control ofits bladder too, can't handle the WAV.
>
> What versions have I got?
> flac 1.1.2-5
> lame 3.97-0.0
> sox 12.17.9-1
>
> An example file that neither FLAC nor LAME nor sox seems to be able handle is:
>
> Length : 114221044
> RIFF : 114221036
> WAVE
> fmt : 16
> Format : 0x3 => WAVE_FORMAT_IEEE_FLOAT
> Channels : 2
> Sample Rate : 48000
> Block Align : 8
> Bit Width : 32
> Bytes/sec : 384000
> data : 114221000
> End
>
> ----------------------------------------
> Sample Rate : 48000
> Frames : 14277625
> Channels : 2
> Format : 0x00010006
> Sections : 1
> Seekable : TRUE
> Duration : 00:04:57.450
> Signal Max : 0.724668 (-2.80 dB)
>
> This is the format that jack_capture produces. It supposedly has options to save in other bit-depths, which I tried, but they didn't seem to do anything.
>
> Granted, I can open these files in Audacity or Rezound or Sweep, and with the GUI convert the file to just about anything. However, I dislike GUI's, and I'd like to be able to do this with the commandline tools. Opening 20 WAV files and click-clacking around on menu options is anathaema: the whole process wants to be a 1-liner bash script really.
>

OK after a bit more experimentation, I solved my own problem.

This is for converting from 32-bit 48000 to redbook CD format:
        sox something-32bit.wav -t wav -w -r 44100 something-cd.wav resample -ql

And, for making FLAC's:
        sox something-32bit.wav -w -t wav - | flac - > something.flac

A similar thing works for making mp3's; I just pipe it to lame instead of to flac. Et voila.

The version of sox on one of my machines does indeed seem to be able to handle 32bit floats. I just need to use that machine and all is well.

- -ken
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFzr6Ue8HF+6xeOIcRAgjvAKD8CUSmjIMKzOLccJhN1KkyvTrr8QCgl0DN
dI1dF9O5PwnVybklcSQHesQ=
=BGpt
-----END PGP SIGNATURE-----
Received on Sun Feb 11 12:15:04 2007

This archive was generated by hypermail 2.1.8 : Sun Feb 11 2007 - 12:15:04 EET