#!/usr/bin/perl -w # chad c d clark # create: 2005-09-19 # # purpose: this file merges multiple Sun/NeXT files into one file. # # reason: I wanted to merge the .au files from the Cliff Stoll talk # at "Cisco NetWorkers '94" into one .au file. You can download the # original files from http://town.hall.org/radio/University/Stoll/ # # use: # This program reads all file names passed on the command line. # The output will be put into a file named "all.out.au". # # example call: # ./combine-au.pl in-file1.au in-file2.au in-file3.au ... use strict; use Audio::Data; my $total_audio = Audio::Data->new; while (my $name = shift) { print $name, "\n"; my $FIN; open $FIN , $name or die "can't open file " . $! . "\n"; binmode $FIN; my $audio = Audio::Data->new; $audio->Load($FIN); $total_audio .= $audio; close $FIN; } my $FOUT; open $FOUT, ">", "all-out.au"; $total_audio->Save($FOUT); close $FOUT;