Part of aculab.speech View Source View In Hierarchy
Known subclasses: aculab.speech.PlayJob, aculab.speech.SilenceJob
An Abstract Base Class for jobs that play PCM data.
Subclasses must implement get_data(len) to fill the buffer
data. get_data(len) must return the length of the
data written.
Subclasses must overwrite done, and, in their
implementation, they must call PlayJobBase.done and
self.channel.job_done(...).
| Method | __init__ | Create an abstract PlayJob. |
| Method | start | Generic job interface method. |
| Method | done | Generic job interface method. |
| Method | fill_play_buffer | Reactor callback - fills the play buffers on the board. |
| Method | stop | Generic job interface method. |
Create an abstract PlayJob.
Related Aculab documentation: sm_replay_start.| Parameters | channel | The SpeechChannel that
will play the file.
|
| agc | A nonzero value activates automatic gain control | |
| speed | The speed for used for replaying in percent. 0 is the same as 100: normal speed. | |
| volume | The volume adjustment in db. | |
| filetype | The file type. The default is kSMDataFormatALawPCM.
|
Generic job interface method.
Start playback.
Applications should callSpeechChannel.play
or SpeechChannel.start
Generic job interface method.
Must be overwritten and called in subclasses when the job is complete.| Returns | a tuple (reason, duration). Duration is in seconds. | |
| Returns | True if completed | |
Generic job interface method.
Stops the PlayJob.
Applications should call SpeechChannel.stop.
stop_offset will be updated with the
information from the driver.