|
Revision 2270, 2.0 kB
(checked in by kmaclean, 1 year ago)
|
Flac audio processing updates & GPL v3 updates
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
use strict; |
|---|
| 26 |
my ($line, $label, $filein, $fileout, %seen); |
|---|
| 27 |
my (@line_array, $line_array); |
|---|
| 28 |
if (@ARGV != 2) { |
|---|
| 29 |
print "usage: $0 filein fileout\n\n"; |
|---|
| 30 |
exit (0); |
|---|
| 31 |
} |
|---|
| 32 |
|
|---|
| 33 |
($filein, $fileout) = @ARGV; |
|---|
| 34 |
|
|---|
| 35 |
open (FILEIN,"$filein") || die ("Unable to open $filein for reading"); |
|---|
| 36 |
open (FILEOUT,">$fileout") || die ("Unable to open $fileout for writing"); |
|---|
| 37 |
|
|---|
| 38 |
print (FILEOUT "#!MLF!#\n"); |
|---|
| 39 |
while ($line = <FILEIN>) { |
|---|
| 40 |
chomp ($line); |
|---|
| 41 |
if ($line =~ /input speechfile: /) { |
|---|
| 42 |
$line =~ s/input speechfile: //; |
|---|
| 43 |
$line =~ s/\.wav/\.rec/; |
|---|
| 44 |
$line =~ s/wav\///; |
|---|
| 45 |
print (FILEOUT "\"*\/$line\"\n"); |
|---|
| 46 |
} elsif ($line =~ /input MFCC file: /) { |
|---|
| 47 |
$line =~ s/input MFCC file: //; |
|---|
| 48 |
$line =~ s/\.mfc/\.rec/; |
|---|
| 49 |
$line =~ s/mfcc\///; |
|---|
| 50 |
print (FILEOUT "\"*\/$line\"\n"); |
|---|
| 51 |
} elsif ($line =~ /pass1_best: /) { |
|---|
| 52 |
$line =~ s/pass1_best: //; |
|---|
| 53 |
$line =~ s/<s> //; |
|---|
| 54 |
$line =~ s/ <\/s>//; |
|---|
| 55 |
$line =~ s/ <sp>//; |
|---|
| 56 |
@line_array=split(/\s+/, $line); |
|---|
| 57 |
foreach $line_array (@line_array) { |
|---|
| 58 |
print (FILEOUT "$line_array\n"); |
|---|
| 59 |
} |
|---|
| 60 |
print (FILEOUT "\.\n"); |
|---|
| 61 |
} |
|---|
| 62 |
} |
|---|
| 63 |
close(FILEIN); |
|---|
| 64 |
close(FILEOUT); |
|---|