Installing and running the Swedish Filibuster voices

bewgrosseteteΛογισμικό & κατασκευή λογ/κού

13 Δεκ 2013 (πριν από 3 χρόνια και 7 μήνες)

99 εμφανίσεις


Install
ing

and running the
Swedish Filibuster voices




2011
-
02
-
22

Christina Tånnander

TPB





Installing and running the Swedish Filibuster system

Sida
2

Table of contentst

1.

Installation

................................
................................
................................
................................
.......

3

1.1

Perl

................................
................................
................................
................................
...........

3

1.2

Tcl

................................
................................
................................
................................
............

3

1.3

Snack 2.2

................................
................................
................................
................................
..

3

1.4

Filibuster

................................
................................
................................
................................
..

3

2.

Running Filibuster

................................
................................
................................
............................

4

2.1

Input

................................
................................
................................
................................
........

4

2.2

Output

................................
................................
................................
................................
.....

4

3.

How it is done at TPB

................................
................................
.........

Error! Bookmark not defined.




Installing and running the Swedish Filibuster system

Sida
3

1.

Introduction

This document describes how to install and run the Swedish Filibuster voices
, Folke and Tora
.
Note
that the Filibuster voices of other languages have different
file sets.

2.

Installation

The Filibuster text
-
to
-
speech system requires

installations

of Perl,
Tcl

and Snack

in addition to the
Filibuster files.

1.1

Perl

Use
Perl 5.8 or later.

The Perl module DB_File
, which can be downloaded from
http://www.cpan.org/
,
is required
.

For Windows it is recommended to download Perl from
www.strawberryperl.com
, which includes
the
above
-
mentioned Perl module.

1.2

Tcl

Use Tcl 8.4 or Tcl 8.5. It can be downloaded from
www.activestate.com
.

1.3

Snack

2.2

Note that
this

is not the same snack
2.2

that can be downloaded from the web.

For Windows, copy the

delivered

snack2.2 direct
o
ry to
Tcl/lib.

For Unix/Linux the required snack files are
included
in
the Filibuster
dire
c
tory

and include the
following files:

libsound.so

pkgindex.tcl

snack.tcl

1.4

Filibuster

All Filibuster files are
included in the Filibuster directory and can
simply be copied to your Filibuster
path.



Installing and running the Swedish Filibuster system

Sida
4

3.

Running Filibuster

Call Filibuster/narraFil2.tcl to invoke the text
-
to
-
speech system.
Note that narraFil2.tcl is not the
same for Folke and Tora.

There is an option
if quotes should be
announced by a short pause or read out as “citat” and “slut
citat” (only
applicable if the
re are more than three words within the quotes). Specify
--
quote=no

for silent quotations and
--
quote=
yes
for the read out
option.

The
se

argument specifies
that a
Swedish voice should be used.

/Filibuster/
$voice/
narraFil2.tcl
--
quote=no se

/Filibuster/
$voice/
narraFil2.tcl
--
quote=yes

se


2.1

Input

The input
is piped through narraFil2.tcl a
s raw text
ending with a newline (
\
n)
on STDIN.

To close the
pipe, send “
\
n” to narraFil2.tcl.

2.2

Output

The output from narraFil2.tcl

contains

1.

t
he size of the
sound data

2.

the

sound data (wav)

4.

The TPB Filibuster set
-
up

TPB

run
s

Filibuster on a Linux server with several threads to speed up the processing
,

and

t
he TTS is
invoked

from
the TPB
version of Daisy
Pipeline
.

The text is sent to Filibuster sentence by sentence.

Since the system is time and performance consuming, it might be a problem
with longer chunks than
sentences, but this has not been tested.

A
java
code example of
how the output is received can be found
at the end of this document.




Installing and running the Swedish Filibuster system

Sida
5

public TTS_Output

receive() throws TTSException {



TTS_Output result = new TTS_Output();






String size = "";



int c;






long wait = 0;



String timeOutMessage = "";






String transcription = "";






Vector charSequence = new Vector();






byte[] data = null;









DEBUG("begin receive audio data");



// read line containing the transcription of the input text



timeOutMessage = "Wait for the TTS data timed out, was
wating for "





+ "audio data for >>" + mLastText + "<<,
timeout was "





+ mTimeout + " ms, "





+ "this process was started using command "





+ CALL_TTS_SSH_COMMAND;




try {




//wait = TTSUtils.awaitIO(mInput, mTimeout);




wait = awaitIOAndClose(mInput, mTimeout);



} catch (IOException e) {




throw new TTSException(timeOutMessage, e);



}



TTS_TIMEOUT = Math.max(TTS_TIMEOUT, wait);






String s = "";



while ((c = mInput.read()) != '
\
n') {




if (
-
1 == c) {





String msg = "Connection to the TTS was lost
unexpectedly, " +







"read EOF (InputStream.read()
=
-
1) instead of ascii " +







"telling the number of audio
bytes produced.
\
n" +







"Waited for speech >>" +
mLastText + "<<, " +









"this process
was started using command " + CALL_TTS_SSH_COMMAND;





throw new TTSException(msg);




}




s += (char) c;




try {





//wait
= TTSUtils.awaitIO(mInput, mTimeout);





wait = awaitIOAndClose(mInput, mTimeout);




} catch (IOException e) {





throw new TTSException(timeOutMessage, e);




}




TTS_TIMEOUT = Math.max(TTS_TIMEOUT, wait);



}



//result.setSSMLConvert(s);



logger.info("received from tts: " + s);



result.setSSMLConvert(new String(s));

Installing and running the Swedish Filibuster system

Sida
6












//read line containing the number of audio bytes



timeOutMessage = "Wait for the TTS data timed out, was
wating for " +





"audio data for >>" + mLastText + "<<,
t
imeout was " + mTimeout + " ms, " +







"this process was started
using command " + CALL_TTS_SSH_COMMAND;






try {




//wait = TTSUtils.awaitIO(mInput, mTimeout);




wait = awaitIOAndClose(mInput, mTimeout);



} catch (IOException e) {




throw new TT
SException(timeOutMessage, e);



}



TTS_TIMEOUT = Math.max(TTS_TIMEOUT, wait);






while ((c = mInput.read()) != '
\
n') {




if (
-
1 == c) {





String msg = "Connection to the TTS was lost
unexpectedly, " +







"read EOF (InputStream.read()
=
-
1) instea
d of ascii " +







"telling the number of audio
bytes produced.
\
n" +







"Waited for speech >>" +
mLastText + "<<, " +









"this process
was started using command " + CALL_TTS_SSH_COMMAND;





throw new TTSException(msg);




}




size += (char) c;




try {





//wait = TTSUtils.awaitIO(mInput, mTimeout);





wait = awaitIOAndClose(mInput, mTimeout);




} catch (IOException e) {





throw new TTSException(timeOutMessage, e);




}




TTS_TIMEOUT = Math.max(TTS_TIMEOUT, wait);



}






// read the
audio



data = new byte[Integer.parseInt(size)];



int len = data.length;



mTotalAudioSize += data.length;



do {




try {





//wait = TTSUtils.awaitIO(mInput, mTimeout);





wait = awaitIOAndClose(mInput, mTimeout);




} catch (IOException e) {





thr
ow new TTSException(timeOutMessage, e);




}




TTS_TIMEOUT = Math.max(TTS_TIMEOUT, wait);




len
-
= mInput.read(data, data.length
-

len, len);




} while (len > 0);






result.setRaw_data_audio(data);






DEBUG("finished receiving audio data");

Installing and running the Swedish Filibuster system

Sida
7



return

result;


}