| 1 | #!/usr/local/bin/perl -w | ||
| 2 | # -*- cperl -*- | ||
| 3 | # PODNAME: balabolka.pl | ||
| 4 | # ABSTRACT: script converting textfile named $1 | ||
| 5 | # into file $2 | ||
| 6 | # with engine:voice $3 | ||
| 7 | # using balabolka | ||
| 8 | our $VERSION = '20261115.1249'; # VERSION | ||
| 9 | |||
| 10 | |||
| 11 | use v5.32; | ||
| 12 | use IO::File; | ||
| 13 | use IPC::Run; | ||
| 14 | |||
| 15 | # Check arguments | ||
| 16 | die( "Usage: $0 <input_text_file> <output_audio_file> <voice>\n" ) | ||
| 17 | unless( 3 == @ARGV ); | ||
| 18 | |||
| 19 | my ( $textfilename, $audiofilename, $voice ) = @ARGV; | ||
| 20 | |||
| 21 | # Run balabolka, run! | ||
| 22 | my $command = [ "balabolka.exe", | ||
| 23 | "-mqs", | ||
| 24 | $textfilename, | ||
| 25 | $audiofilename, | ||
| 26 | $voice ]; | ||
| 27 | my $out; | ||
| 28 | IPC::Run::run( $command, '>', \$out ); | ||
| 29 | exit( $? ); | ||
| 30 | |||
| 31 | __END__ |