[linux-audio-user] Re: Converting IEEE FLOAT WAV's to ... anything?

From: Kjetil S. Matheussen <k.s.matheussen@email-addr-hidden>
Date: Sun Feb 11 2007 - 17:41:46 EET

Ken Restivo:

>> 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

I think IEEE floats can't be used in flac, because its a lossless
compressor and that it gurantees not to alter the data. Floats are
probably too hard (probably impossible?) to handle to sattisfy
requirements.

>>
>> ----------------------------------------
>> 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

I chose this format as default because its the most common one for audio
processing.

>> options to save in other bit-depths, which I tried, but they didn't
>> seem to do anything.
>>

Works here:

kjetil@email-addr-hidden ~ $ jack_capture -b 16
Recording to "jack_capture_03.wav". Press <Return> or <Ctrl-C> to stop it.

Please wait while writing all data to disk. (shouldn't take long)
disk thread finished
connection thread finished

kjetil@email-addr-hidden ~ $ sfinfo jack_capture_03.wav
File Name jack_capture_03.wav
File Format Microsoft RIFF WAVE Format (wave)
Data Format 16-bit integer (2's complement, little endian)
Audio Data 278528 bytes begins at offset 44 (2c hex)
                2 channels, 69632 frames
Sampling Rate 44100.00 Hz
Duration 1.579 seconds

>> 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
>

You might want to be careful with sox's resampling... You probably want to
listen to the results, but sndfile-resample or resample are probably
safer program to use instead.

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

jack_capture actually supports flac very conveniently:
"$jack_capture -f flac"

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

I have a script called makemp3.sh that looks like this:

#!/bin/sh

sndfile-convert -pcm32 $1.wav $1o.wav
lame $1o.wav
mv $1o.wav.mp3 $1.mp3
rm $1o.wav
Received on Sun Feb 11 20:15:01 2007

This archive was generated by hypermail 2.1.8 : Sun Feb 11 2007 - 20:15:01 EET