NAME
Audio::CoolEdit::Write - Methods for writing Syntrillium CoolEdit Pro .ses files.
SYNOPSIS
use Audio::CoolEdit;
my $cool = new Audio::CoolEdit;
my $details = {
'bits_sample' => 16,
'sample_rate' => 44100,
};
my $write = $cool -> write( './test', $details );
NOTES
This module shouldn't be used directly, a blessed object can be returned from Audio::CoolEdit.
AUTHOR
Nick Peskett - nick@soup.demon.co.uk
SEE ALSO
L<Audio::CoolEdit>
L<Audio::CoolEdit::Read>
METHODS
file_name
Returns the filename of the session file to be written.
my $file = $write -> file_name();
add_file
Adds a wav file to the current ses file. Takes a reference to a hash as the only parameter. This hash should at least contain a path to the wav file.
use Audio::Tools::Fades;
my $fade_type = 'trig';
my $fade_length = 20000;
my $fades = new Audio::Tools::Fades;
my $fade_sub = $fades -> fade( $fade_length, 0, $fade_type );
my $record = {
'file' => './t/testout.wav',
'offset' => 0,
'title' => "song 1",
'fade' => {
'in' => {
'type' => $fade_type,
'fade' => $fade_sub,
'start' => 0,
'end' => $fade_length,
},
},
};
$write -> add_file( $record );
Parameters are; (* optional)
file => path to wav file
offset* => offset in bytes to place the file.
start* => the byte offset to start the file at.
end* => the byte offset to stop the file at.
length* => length of data in bytes
title* => title of file
fade* => this should be a reference to a hash
If you don't supply length or offset you will need to install the Audio::Wav module so the file can be analysed.
The fade hash should be in the following format; see Audio::Tools::Fades
in/out => {
type => linear/ exp/ invexp/ trig/ invtrig
fade => return from Audio::Tools::Fades -> fade method,
start => fade starts (bytes),
end => fade ends (bytes),
}
add_cue
Adds a cuepoint to the current file.
$write -> add_cue( $byte_offset, 'Name', 'Description' );
finish
Finish & write the current file.
$write -> finish();