deepspeech_service

Module Contents

Classes

SpeechToTextService

Speech to text service using DeepSpeech

Functions

main()

Set names, collect params, and give service to server

class deepspeech_service.SpeechToTextService(name, param)

Bases: harmoni_common_lib.service_manager.HarmoniServiceManager

Speech to text service using DeepSpeech

ds_client

Set up publishers and subscribers

start(self)

Start the DeepSpeech stream

stop(self)

Stop the DeepSpeech stream

pause(self)

Pause the DeepSpeech stream

sound_data_callback(self, data)

Callback function subscribing to the microphone topic. Passes audio data to the DeepSpeech client.

transcribe_stream(self, data, is_transcribe_once=False)

Continuously passes chunks of audio to the DeepSpeech client. Final text, as determined by the DeepSpeech client, is published.

request(self, data)

Request to DeepSpeech client: requests to transcribe one instance of speech. Text is considered final based on the duration of the t_wait parameter.

_transcribe_chunk(self, data)

Passes one chunk of audio to the DeepSpeech client

playing_sound_pause_callback(self, data)

Sleeps when data is being published to the speaker

deepspeech_service.main()

Set names, collect params, and give service to server