Class a.s.PlayJobBase(object):

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(...).

Read the code for more details.
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.
def __init__(self, channel, agc=0, speed=0, volume=0, filetype=None): (source)

Create an abstract PlayJob.

Related Aculab documentation: sm_replay_start.
ParameterschannelThe SpeechChannel that will play the file.
agcA nonzero value activates automatic gain control
speedThe speed for used for replaying in percent. 0 is the same as 100: normal speed.
volumeThe volume adjustment in db.
filetypeThe file type. The default is kSMDataFormatALawPCM.
def start(self): (source)

Generic job interface method.

Start playback.

Applications should call SpeechChannel.play or SpeechChannel.start
def done(self): (source)

Generic job interface method.

Must be overwritten and called in subclasses when the job is complete.
Returnsa tuple (reason, duration). Duration is in seconds.
def fill_play_buffer(self): (source)
Reactor callback - fills the play buffers on the board.
ReturnsTrue if completed
def stop(self): (source)

Generic job interface method.

Stops the PlayJob.

Applications should call SpeechChannel.stop.

The internal position stop_offset will be updated with the information from the driver.
API Documentation for pyAculab, generated by pydoctor at 2009-01-02 15:12:29.