Bob Wilkinson > Audio-Gramofile > examples/process_wav.pl

Download:
Audio-Gramofile-0.08.tar.gz

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

process_wav.pl ^

Overview

This script demonstrates use of the XS interface to libgramofile (available from http://sourceforge.net/projects/libgramofile) which is derived from J. A. Bezemer's Gramofile program (available from http://www.opensourcepartners.nl/~costar/gramofile/).

Gramofile can be used to convert large wav files generated from e.g. vinyl LPs into a number of constituent wav files (i.e. the songs on the LP or cassette).

This program allowed me to record many sides of vinyl, and then run the conversion to flac, mp3 and ogg vorbis files in batch-mode. A scriptable program is better than an interactive one when the parameters change little.

This code splits the file, and then filters the signal by applying some of the filters available from gramofile. These split and processed wav files are post-processed with sox, which adjusts the volume of the file to the maximum possible without clipping. The wav files are then converted to mp3 format by using lame, to ogg format by using oggenc, and to lossless compressed wav format by flac.

The raw wav files were recorded using the standard curses interface to gramofile, or the Gnome Sound Recorder.

sox is available from http://home.sprynet.com/~cbagwell/sox.html lame is available from www.sulaco.org oggenc is available from www.xiph.org as part of vorbis-tools flac is available from http://sourceforge.net/projects/flac/

Pragmatism

Infrequently (e.g. with live albums) it's difficult to accurately split the wav files into their constituent tracks. In this case the .tracks files created by the track splitting process were hand edited (xmms can play wav files, and it displays times, too. glame gives more fine control over timings). This program was then re-run on the wav file with the flag $use_tracksplit switched off.

syntax highlighting: