Voice Recognition Service

Speech API algorithm

class sksurgeryspeech.algorithms.voice_recognition_service.VoiceRecognitionService(config: dict)[source]

Bases: PySide2.QtCore.QObject

Voice Recognition service which takes an microphone input and converts it to text by using the Google Cloud Speech-to-Text API.

Configuration dictionary must contain the following keys:

porcupine dynamic library path: Porcupine/lib/<operating_system>/<processor_type>/<library_file>

porcupine model file path: Porcupine/lib/common/porcupine_params.pv

porcupine keyword file(s): Porcupine/resources/keyword_files/<operating_system>/<keyword>

optional keys:

google credentials file: json file with google cloud api credentials

recogniser: api to use, options are sphinx, google, google_cloud, bing, houdify, ibm, wit

sphinx keywords: a list of keywords and sensitivities for sphinx timeout for command: default None

google_api_not_understand
google_api_request_failure
listen_for_keyword()[source]

This method is called every 100 milliseconds by the QThread running and listens for the keyword

listen_to_command()[source]

This method gets called when a specific command is said. It then listens for specific commands and converts them to QT Signals

request_stop()[source]

Called by external client to stop timer.

run()[source]

Entry point for the QThread which starts the timer to listen in the background

start_listen
start_processing_request
staticMetaObject = <PySide2.QtCore.QMetaObject object>
stop_timer
voice_command