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 http://downloads.cepstral.com/cepstral/i386-linux/Cepstral_Allison_i386-linux_4.2.1.tar.gz
--22:01:46-- http://downloads.cepstral.com/cepstral/i386-linux/Cepstral_Allison_i386-linux_4.2.1.tar.gz
=> `Cepstral_Allison_i386-linux_4.2.1.tar.gz'
Resolving downloads.cepstral.com... 216.92.127.89
Connecting to downloads.cepstral.com|216.92.127.89|: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]

lmntel01:/usr/src#


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:

lmntel01:/usr/src/Cepstral_Allison_i386-linux_4.2.1/#./install.sh


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/ld.so.conf and run ldconfig as root:

/opt/swift/lib

(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! *******************
***************************************************************************

lmntel01:/usr/src/Cepstral_Allison_i386-linux_4.2.1/#


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' =-

[Synopsis]
Speak text through Swift text-to-speech engine.

[Description]
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
rbast:~/Cepstral_Allison_i386-linux_4.2.1#


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: