08 Oct 1999 17:47:28 UTC
- Distribution: speech_pm
- Module version: 1.0
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (0 / 333 / 0)
- KwaliteeBus factor: 0
- License: unknown
- Download (11.37KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Speech::Synthesiser - Generic speech syntheiser interface
use Speech::Synthesiser; $synth = new Speech::Synthesiser -type => 'SynthName', # other args ; start $synth; stop $synth; @voices = voice_list $synth; voice $synth "myvoice"; intro $synth; speak $synth $text;
Speech::Synthesiser provides a simple way to add speech to a perl application. It is a generic class which can be used to talk to any speech synthesiser given a suitable interface module.
Actual sound output is provided by an auiliary class, by default Audio::FileWave which runs an external program to play sound, but you can replace it with another class if you have a better way of playing sounds (eg a perl extension providing sound output), see the documentation for Speech::FileWave for the interface an alternative should provide should implement.
- $synth = new Speech::Synthesiser -type => 'SynthName', ARGS;
Create a synthesiser of the named type. Looks for a package
Speech::SynthName::Synthesiser. All arguments are passed to the creation function for that class.
The following arguments have special meaning to the
- start $synth;
Do whatever is ncecessary to prepar ethe synthesiser fo work. Returns true if all is well, false otherwise. In the event of an error the variable $synth_error conatains a description of it.
- stop $synth;
Close down the synthesiser, releasing any resources it holds. The synthesiser may be restarted with "start", but any state may have been lost.
- @voices = voice_list $synth;
Return a list of the voices available from this synthesiser.
- voice $synth "myvoice";
Select a voice.
- voice_description $synth;
Returns a description of the voice.
- synth_description $synth;
Synthesize a description of the synthesiser,
- speak $synth $text;
Speak the given text. Not much more to be said really:-).
The following should talk to you, all else being equal. Uses the festival synthesiser, so you will need to run a festival server on the named machine.
use Speech::Synthesiser; $synth = new Speech::Synthesiser -type => 'Festival', -host => 'festival-server.mynet'; start $synth || die "can't talk to festival - $synth_error"; speak $synth "We are perl, prepare for assimilation.";
Richard Caley, R.Caley@ed.ac.uk
Module Install Instructions
To install Audio::FileWave, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Audio::FileWave
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|