Module a.speech

Part of aculab View Source

The SpeechChannel and higher level speech processing functions.

The SpeechChannel is a full duplex prosody channel with speech processing functions like play, record, digits or tone.

Internally, all speech processing functions in this module are represented as jobs. A job starts an audio operation, monitors it while it is running, and notifies the Controller when it is finished. Also, a job can stop its operation.

For simple applications, jobs may be ignored, but they are a useful building block for IVR-type applications. For an example, look at am/am.py. This is an an answering machine that implements its user interaction as a queue of jobs.
Function guess_filetype Guess format, sampling rate and data rate from the file extension.
Class PlayJobBase An Abstract Base Class for jobs that play PCM data.
Class PlayJob Job to play a file.
Class SilenceJob Job to play silence.
Class RecordJob Job to record a file.
Class DigitsJob Job to play a string of DTMF digits.
Class ToneJob Job to play a predefined Tone.
Class DCReadJob A DataComms receive job - experimental
Class SpeechChannel A full duplex Prosody channel.
Class Conference A Conference: seriously incomplete.
Class Glue Glue logic to tie a SpeechChannel to a Call.
def guess_filetype(fn): (source)

Guess format, sampling rate and data rate from the file extension.

Currently recognized are .al (alaw, 8kHz) .ul (mulaw, 8kHz) and .sw (16bit/sample, signed, 8 kHz).
Returnsa tuple (format, sampling rate, data rate).
API Documentation for pyAculab, generated by pydoctor at 2009-01-02 15:12:29.