Created
December 24, 2009 20:22
-
-
Save fuba/263353 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ julius, mecab, saykana, ffmpeg インストールする | |
+ dictation-kit もってくる | |
+ dictation-kit-v4.0/fast.jconf の -input を rawfile にする | |
+ wav2text.pl の fast.jconf のパスを修正 | |
+ 実行 | |
$ cat textfile | perl saykana_wrapper.pl /tmp/sample.wav && wav2text.pl /tmp/sample.wav | |
+ textfile の内容がへんなテキストになって楽しい |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use utf8; | |
use strict; | |
use warnings; | |
use Encode; | |
my $filename = shift or die 'specify filename with suffix (.wav, mp3, ...)'; | |
my $text = decode_utf8(do { local $/; <STDIN> }); | |
$text =~ s/[\n。]/ /g; | |
open my $mecab, '|-', "mecab -Oyomi | SayKana -f - -o /tmp/sample.aiff"; | |
print $mecab encode_utf8($text); | |
close $mecab; | |
system("ffmpeg -y -i /tmp/sample.aiff -ar 16000 $filename"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $wavfile = shift; | |
my $julius = `echo $wavfile | julius -charconv EUC-JP UTF-8 -C src/dictation-kit-v4.0/fast.jconf`; # ここ編集 | |
$julius =~ /sentence\d+\:\s+([^\r\n]*)/; | |
print $1."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment