Sony audio (MSV), and LAME is lame (was: Anyone...)
Ben Scott
dragonhawk at gmail.com
Wed Oct 3 22:27:48 EDT 2007
On 10/2/07, Steven W. Orr <steveo at syslang.net> wrote:
> Someone bought a cheap voice recorder and it seems it produces these MSV
> files. Any known way to convert it or is this more uSoft crap?
I had a chance to play around more with the .WAV files produced by
my Sone Clie's voice recorder. I could play the Sony file with
"mplayer", which identified it as follows (edited for brevity):
[imaadpcm] IMA ADPCM audio, 22050 Hz, 1 ch, s16le, 88.9 kbit/25.20%
(ratio: 11111->44100)
... whatever that means. However, if I ran LAME on the file, it
complained that the file was unrecognized and assumed raw input; the
output MP3 was just a constant hiss. So LAME apparently can't do
anything with it.
The always-capable sox(1) program, however, seemed to know what to
do. I was able to convert it to a Microsoft "standard" .WAV file by
doing this:
sox -S -V sony.wav -a msft.wav
(The -S and -V just tell sox(1) to provide status and verbose
information; the -a before "msft.wav" means it's a Microsoft ADPCM
WAV.)
That produced another file which LAME couldn't do anything useful
with. :( However, mplayer and file(1) both agree the file is
different:
msft.wav: RIFF (little-endian) data, WAVE audio, Microsoft ADPCM, mono 22050 Hz
sony.wav: RIFF (little-endian) data, WAVE audio, IMA ADPCM, mono 22050 Hz
Since LAME keeps insisting on treating my file as raw, I decided to
have a go at figuring out that in Sox. I finally ended up with this:
sox -S -V sony.wav -s signed-16bit-1ch-22050hz.raw
(The "-s" means "signed linear", and Sox defaults everything else to
the same as the input file. The gratuitously long file name is
because raw files have no header, and I wanted to be able to keep
things straight for myself.)
I was able to have mplayer play that file by specifying everything manually:
mplayer -rawaudio channels=1:rate=22050:samplesize=2 -demuxer
rawaudio signed-16bit-1ch-22050hz.raw
(As an aside: You can get a rather interesting effect by running
mplayer on a raw sound file without specifying what the file is. For
even more fun, run it full-screen. Don't try this if you have
epilepsy.)
But LAME still creates a file full of static, even when I feed it
all the options it says it needs:
lame -r -s 22.05 --bitwidth 16 --signed -m mono
signed-16bit-1ch-22050hz.raw
Interestingly, FLAC does appear to be able to handle the raw file:
flac --endian little --sign unsigned --channels 1 --bps 16
--sample-rate=22050 unsigned-16bit-1ch-22050hz.raw
At this point, I have to conclude LAME is just lame. HHOS. Maybe
it's just borken on Fedora 6 plus whatever-repository-I-got-it-from.
mencoder doesn't appear to want to work if given only an input file
("Video stream is mandatory!").
And now I have to get back to working on other crap. If anyone
knows WTF I'm doing wrong with either LAME or mencoder, I'd love to
hear about it!
-- Ben
More information about the gnhlug-discuss
mailing list