streamtotext.transcriber module

Transciption components

The main base class which is responsible for performing transcription is Transcriber.

exception streamtotext.transcriber.AlreadyRunningError

Bases: Exception

exception streamtotext.transcriber.AlreadyStoppedError

Bases: Exception

class streamtotext.transcriber.GoogleTranscribeEvent(results, final, stability)

Bases: streamtotext.transcriber.TranscribeEvent

class streamtotext.transcriber.PocketSphinxTranscriber(source, hmm_path, lm_path, dict_path)

Bases: streamtotext.transcriber.Transcriber

Local transcriber which uses pocketsphinx.

Note: This transcriber does not support streaming. The audio source needs to emit events in bulk. See Bulk Transcription for more information.

Parameters:source (audio.AudioSource) – Input audio source
static default_config(source, model_dir=None)
utterance()
class streamtotext.transcriber.TranscribeEvent(results, final)

Bases: object

class streamtotext.transcriber.TranscribeResult(transcript, confidence=None)

Bases: object

class streamtotext.transcriber.Transcriber(source)

Bases: object

Base class for implementing a transcriber.

Once transcribe() is called a transcriber awaits on get_chunk from an audio source and then streams them to a transcription service.

Parameters:source (audio.AudioSource) – Input audio source
register_event_handler(handler)
exception streamtotext.transcriber.WatsonStartError(msg)

Bases: Exception

class streamtotext.transcriber.WatsonTranscriber(source, source_freq, user, password, host='stream.watsonplatform.net', uri_base='/speech-to-text/api/v1/recognize', model='en-US_BroadbandModel')

Bases: streamtotext.transcriber.Transcriber