
Audio::Gramofile - Perl interface to libgramofile, a library derived from Gramofile

use Audio::Gramofile;
my $gramofile = Audio::Gramofile->new;
$gramofile->set_input_file($wav_file);
$gramofile->set_output_file($out_file);
# track splitting methods
$gramofile->init_tracksplit("make_use_rms" => 1);
$gramofile->split_to_tracks;
# signal processing methods
$gramofile->init_filter_tracks(@filter_list);
$gramofile->init_simple_median_filter("num_samples" => 7);
$gramofile->init_double_median_filter("first_num_samples" => 5);
$gramofile->init_simple_mean_filter("num_samples" => 9);
$gramofile->init_rms_filter("num_samples" => 3);
$gramofile->init_cmf_filter("rms_length" => 9);
$gramofile->init_cmf2_filter("rec_med_len" => 11);
$gramofile->init_cmf3_filter("fft_length" => 8);
$gramofile->init_simple_normalize_filter("normalize_factor" => 25);
$gramofile->use_begin_end_time($begin_time, $end_time);
$gramofile->process_whole_file;
$gramofile->adjust_frames($framesize);
$gramofile->filter_tracks;

This module provides a Perl interface to Gramofile, a program for recording gramophone records. It is able to record hours of CD quality music, split long sound files in separate tracks, and remove ticks and pops from recordings.
Gramofile was written by Anne Bezemer and Ton Le.
Gramofile is available from http://www.opensourcepartners.nl/~costar/gramofile/
libgramofile - a library derived from Gramofile is available from http://sourceforge.net/projects/libgramofile

returns an object initialised with the parameters specified in the original C code.
e.g. my $gramofile = Audio::Gramofile->new;
sets the input .wav file for track splitting and signal processing methods.
e.g. $gramofile->set_input_file($wav_file);
The following elements may be initialised by this method. All are used to modify the track splitting algorithm.
make_use_rms # Save/load signal power (RMS) data to/from .rms file
make_graphs # Generate graph files
blocklen # Length of blocks of signal power data (samples)
global_silence_factor # Global silence factor (0.1 %)
local_silence_threshold # Local silence factor (%)
min_silence_blocks # Minimal length of inter-track silence (blocks)
min_track_blocks # Minimal length of tracks (blocks)
extra_blocks_start # Number of extra blocks at track start
extra_blocks_end # Number of extra blocks at track end
e.g. $gramofile->init_tracksplit("make_use_rms" => 1, "min_silence_blocks" => 10);
The input file is split into a number of tracks. A file with name new.wav will be split into tracks called new01.wav, new02.wav etc.
e.g. $gramofile->split_to_tracks;
Any, or all, of the following filters may be specified:
The filters are applied in the order given in the list.
e.g. $gramofile->init_filter_tracks("rms_filter", "simple_mean_filter");
by default the cond_median2_filter is used.
sets the output .wav file name for the signal processing method, filter_tracks.
e.g. $gramofile->set_output_file($out_file);
This method allows the parameters to be set for the simple median filter.
The following elements may be set for this filter:
e.g. $gramofile->init_simple_median_filter("num_samples" => 7);
This method allows the parameters to be set for the simple median filter.
The following elements may be set for this filter:
e.g. $gramofile->init_double_median_filter("first_num_samples" => 5);
This method allows the parameters to be set for the simple mean filter.
The following elements may be set for this filter:
e.g. $gramofile->init_simple_mean_filter("num_samples" => 9);
This method allows the parameters to be set for the rms filter.
The following elements may be set for this filter:
e.g. $gramofile->init_rms_filter("num_samples" => 3);
This method allows the parameters to be set for the conditional mean filter.
The following elements may be set for this filter:
e.g. $gramofile->init_cmf_filter("rms_length" => 9, "tick_threshold" => 3000);
This method allows the parameters to be set for the second conditional mean filter.
The following elements may be set for this filter:
e.g. $gramofile->init_cmf2_filter("rec_med_len" => 11, "fine_threshold" => 2500);
This method allows the parameters to be set for the second conditional mean (frequency domain using fft) filter.
The following elements may be set for this filter:
e.g. $gramofile->init_cmf3_filter("fft_length" => 8, "fine_threshold" => 2500);
This method allows the parameters to be set for the simple normalize filter.
The following elements may be set for this filter:
e.g. $gramofile->init_simple_normalize_filter("normalize_factor" => 50);
A begin time and end time can be specified. These times will be used instead of the track times derived from the split_to_tracks method.
e.g. $gramofile->use_begin_end_time($begin_time, $end_time);
The whole file can be passed through the signal processing routines if this method is used.
e.g. $gramofile->process_whole_file;
The default frame size is 588 (1/75 sec. @ 44.1 khz). This method allows this value to be user-defined.
e.g. $gramofile->adjust_frames($framesize);
This method filters the tracks with the previously specified (or default) parameters.
e.g. $gramofile->filter_tracks;

None by default.

Gramofile : available from http://www.opensourcepartners.nl/~costar/gramofile/
libgramofile : A dynamically linked library derived from Gramofile, which this module needs, available from http://sourceforge.net/projects/libgramofile
fftw - the fastest Fourier Transform in the west : available from http://www.fftw.org
Signproc.txt, Tracksplit.txt, Tracksplit2.txt supplied with the Gramofile source code.

Bob Wilkinson, <bob@fourtheye.org>

Copyright 2003-2005 by Bob Wilkinson
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.