Thursday, February 14, 2008

Cepstral Allison on Asterisk 1.4 Test

Download the Ceptrals voice of your preference and system. I like Allison particularly better than the UK one.

Do the download on /usr/src.

lmntel01:/usr/src# wget
=> `Cepstral_Allison_i386-linux_4.2.1.tar.gz'
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 107,474,833 (102M) [application/x-tar]

100%[========================================>] 107,474,833 1.15M/s ETA 00:00

22:03:26 (1.03 MB/s) - `Cepstral_Allison_i386-linux_4.2.1.tar.gz' saved [107474833/107474833]


Untar the file and enter the directory:

lmntel01:/usr/src#tar -xzvf Cepstral_Allison_i386-linux_4.2.1.tar.gz
lmntel01:/usr/src#cd Cepstral_Allison_i386-linux_4.2.1

Execute the installation script:


The installation process goes like this:

Do you agree to these terms? Enter -yes- to continue: yes

Install into what directory? [/opt/swift]

Swift will be installed in the following directories:

Voices in /opt/swift/voices
Shared libraries in /opt/swift/lib
Binaries in /opt/swift/bin
Configuration file in /opt/swift/etc
Header files in /opt/swift/include
Examples in /opt/swift/examples
Sound effects filters in /opt/swift/sfx
Documentation in /opt/swift/doc

Is this acceptable? Enter 'yes' to continue: yes

Installing libraries...

If you are installing Swift system-wide, you may need to add the following
line to /etc/ and run ldconfig as root:


(Otherwise, you will need to add it to the LD_LIBRARY_PATH environment
variable in order to run programs linked against the Swift libraries.)

Installing voice Allison...

Creating configuration...

Installing binaries...
Installing symbolic link to swift...
Installing man page...

Setting permissions...

Testing the installed swift binary...
/opt/swift/bin/swift -o /dev/null 'hello world'

****************** Installation Completed Successfully! *******************


After this you must restart Asterisk and after the reboot to confirm the installation run the command below and check the outpu.

lmntel01:/usr/src/Cepstral_Allison_i386-linux_4.2.1/#asterisk -rx "core show application swift"

-= Info about application 'Swift' =-

Speak text through Swift text-to-speech engine.

Swift(text) Speaks the given text through the Swift TTS engine.
Returns -1 on hangup or 0 otherwise. User can exit by pressing any key.

-- Remote UNIX connection

Also you can generate a TTS wav file on the command line by running:

To test the installation you can:
/opt/swift/bin/swift -o /tmp/test.wav -p audio/sampling-rate=8000,audio/channels=1 "This is a test."

And finally just create an extension on the context of your choice to play it:

exten => 1234,1,Answer()
exten => 1234,2,Playback(/tmp/test)
exten => 1234,3,Hangup()

You will notice that as there is not a license for this package you will hear an introduction message asking you to buy a license on Cepstral web site.

No comments: