harmoni_stt.google_service

Module Contents

Classes

STTGoogleService

Google service

Functions

main()

Set names, collect params, and give service to server

class harmoni_stt.google_service.STTGoogleService(name, param)

Bases: harmoni_common_lib.service_manager.HarmoniServiceManager

Google service

closed = False

Setup the google request

data = b''

Setup publishers and subscribers

pause_back(data)
setup_google()
callback(data)

Callback function subscribing to the microphone topic

transcribe_file_request(data)

Transcribes a single audio file

listen_print_until_result_is_final(responses)

Prints responses coming from Google STT

stt_callback(data)

Callback function subscribing to the microphone topic

request(data)

Make a request of another service, such as a web service

When request returns it should return the result of the request and set status

Raises:

NotImplementedError – To be used, this function should be overwritten by the child class.

wav_to_data(path)
generator()

Generator of data for Google STT

start(rate='')

Will start a long running action. This could be reading hardware and publishing it to a topic or running a behavior pattern. For atomic actions use do()

Start actions can be long running or indefinate.

Raises:

NotImplementedError – To be used, this function should be overwritten by the child class.

stop()

Will interrupt the long running action

Raises:

NotImplementedError – To be used, this function should be overwritten by the child class.

pause()

Will interrupt the long running action, preventing it from continuing until start is called again.

Raises:

NotImplementedError – To be used, this function should be overwritten by the child class.

harmoni_stt.google_service.main()

Set names, collect params, and give service to server