voxforge.org
VoxForge Dev

Changeset 2581

Show
Ignore:
Timestamp:
05/12/08 22:45:58 (7 months ago)
Author:
kmaclean
Message:

Change audio processing scripts (Audio.pm) to convert audio to mono when migrating to Main directory; update svn properties

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/Scripts/Audio_scripts/Repository/Main.pm

    r2422 r2581  
    5151        # update properties 
    5252        $command = ("svn propset -R sampling_rate_Hz $downsample_rate $path_main/$audio_dir_name"); print "$command\n" if $debug;  system($command) == 0 or confess "system $command failed: $?";   
    53         $command = ("svn propset -R bits_per_sample $downsample_bits_per_sample $path_main/$audio_dir_name" ); print "$command\n" if $debug;  system($command) == 0 or confess "system $command failed: $?";   
     53        $command = ("svn propset -R bits_per_sample $downsample_bits_per_sample $path_main/$audio_dir_name" ); print "$command\n" if $debug;  system($command) == 0 or confess "system $command failed: $?"; 
     54        # !!!!!! 
     55        if ($readme->getChannels() > 1) { 
     56                $command = ("svn propset -R number_of_channels:1" ); print "$command\n" if $debug;  system($command) == 0 or confess "system $command failed: $?"; 
     57        } 
     58        # !!!!!!           
    5459        $command = ("svn update -r HEAD $path_main/$audio_dir_name");print "$command\n" if $debug;  system($command) == 0 or confess "system $command failed: $?";     
    5560        $command = ("svn commit -m \"downsampled $audio_dir_name audio files & updated properties\" $path_main/$audio_dir_name"); print "$command\n" if $debug;  system($command) == 0 or confess "system $command failed: $?";       
  • Trunk/Scripts/Audio_scripts/UserSubmission/README.pm

    r2520 r2581  
    105105                        $readmecontents{'samplingrate'} =~ s/441/44\.1/g;  
    106106                        $readmecontents{'samplingrate'} = $readmecontents{'samplingrate'} . "kHz"; 
    107                 #       print "Samplingrate:$samplingrate\n" if $debug;  
    108107                } elsif ($line =~ /Sample rate format:/i) { 
    109108                        $line =~ s/ //g; # remove spaces         
     
    112111                        $readmecontents{'samplingrateformat'} =~ s/\D//g; # removes anything other than a digit  
    113112                        $readmecontents{'samplingrateformat'} = $readmecontents{'samplingrateformat'} ."bit"; 
    114                 #        print "Samplingrateformat:$samplingrateformat\n" if $debug;     
     113                } elsif ($line =~ /Number of channels:/i) { 
     114                        ($title, $readmecontents{'channels'}) =split(/\:/, $line); 
     115                        $readmecontents{'channels'} =~ s/ //g; # remove spaces 
    115116                } elsif ($line =~ /Pronunciation dialect:/i) { 
    116117                        ($title, $readmecontents{'dialect'}) =split(/\:/, $line); 
    117118                        $readmecontents{'dialect'} =~ s/^ //g;           # remove leading space  
    118                 #        print "dialect:$dialect\n" if $debug; 
    119119                } elsif ($line =~ /File type:/i) { 
    120120                        $line =~ s/ //g; # remove spaces         
    121121                        ($title, $readmecontents{'filetype'}) =split(/\:/, $line); 
    122122                        $readmecontents{'filetype'} = lc $readmecontents{'filetype'}; #lower case 
    123                 #        print "filetype:$filetype\n" if $debug;                                         
    124123                } elsif ($line =~ /Language: /i) { 
    125124                        # $line =~ s/ //g; # not required 
     
    188187        return $self->{'contents'}; 
    189188} 
     189 
     190sub getChannels { 
     191        my $self = shift; 
     192        return $self->{'channels'}; 
     193} 
    1901941;