View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Bob Wilkinson > Audio-Gramofile > examples/


Annotate this POD


Open  0
View/Report Bugs
Source ^


This script demonstrates use of the XS interface to libgramofile (available from which is derived from J. A. Bezemer's Gramofile program (available from

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 lame is available from oggenc is available from as part of vorbis-tools flac is available from


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: