Changeset 2580
- Timestamp:
- 05/12/08 22:30:31 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/Scripts/Audio_scripts/UserSubmission/AUDIO.pm
r2534 r2580 83 83 if ($suffix eq "wav") { 84 84 print "downsampling:$directory\/$filename\n" if $debug; 85 $command = ("sox $directory/$filename - r $targetrate -w $directory/temp-$filename"); system($command) == 0 or confess "system $command failed: $?";85 $command = ("sox $directory/$filename -c 1 -r $targetrate -w $directory/temp-$filename"); system($command) == 0 or confess "system $command failed: $?"; 86 86 $command = ("mv $directory/temp-$filename $directory/$filename"); system($command) == 0 or confess "system $command failed: $?"; 87 87 } elsif ($suffix eq "raw") { # convert raw files to wav (i.e. add a wav header) 88 88 print "downsampling:$directory\/$filename\n" if $debug; 89 $command = ("sox -r $original_sampling_rate -s -w $directory/$filename - t wav -r $targetrate -w $directory/temp-$filename"); system($command) == 0 or confess "$command failed: $?";89 $command = ("sox -r $original_sampling_rate -s -w $directory/$filename -c 1 -t wav -r $targetrate -w $directory/temp-$filename"); system($command) == 0 or confess "$command failed: $?"; 90 90 # need to leave 'raw' filename unchanged (i.e. don't rename it to wav) 91 91 # only change filenames using svn, otherwise lose you svn history on the file. … … 98 98 # downsample 99 99 # flac can encode and downsample at the same time, but there are different types of downsampling algorithms ... not sure what flac uses - stick with sox. 100 $command = ("sox $directory/$filename_nosuffix\.wav - r $targetrate -w $directory/temp-$filename_nosuffix\.wav"); print "$command\n" if $debug; system($command) == 0 or confess "system $command failed: $?";100 $command = ("sox $directory/$filename_nosuffix\.wav -c 1 -r $targetrate -w $directory/temp-$filename_nosuffix\.wav"); print "$command\n" if $debug; system($command) == 0 or confess "system $command failed: $?"; 101 101 # convert back to flac; overwrite original file 102 102 $command = ("flac -eVf $directory/temp-$filename_nosuffix\.wav -o $directory/$filename"); print "$command\n" if $debug; system($command) == 0 or confess "system $command failed: $?";