Example #1
0
    def __init__(self, callback=None, **kwargs):
        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        self.main_controller_callback = callback
        self.language = kwargs.get('language', "model-fr")
        self.log_level = kwargs.get('log_level', -1)
        self.grammar_file = kwargs.get('grammar_file', None)

        self.set_callback(self.deepspeech_callback)
        self.start_processing()
Example #2
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with CMU sphinx api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        SpeechRecognition.__init__(self)

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback

        # start listening in the background
        self.set_callback(self.sphinx_callback)
        self.start_listening()
Example #3
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with Vosk
        :param callback: The callback function to call to send the text
        :param kwargs:
        """

        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        self.main_controller_callback = callback
        self.language = kwargs.get('language', "model-fr")
        self.grammar_file = kwargs.get('grammar_file', None)

        self.set_callback(self.vosk_callback)
        self.start_processing()
Example #4
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with CMU sphinx api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        # give the audio file path to process directly to the mother class if exist
        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback

        # start listening in the background
        self.set_callback(self.sphinx_callback)
        # start processing, record a sample from the microphone if no audio file path provided, else read the file
        self.start_processing()
Example #5
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with Wit.ai api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        SpeechRecognition.__init__(self)

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback
        self.key = kwargs.get('key', None)
        self.show_all = kwargs.get('show_all', False)

        # start listening in the background
        self.set_callback(self.wit_callback)
        self.start_listening()
Example #6
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with Wit.ai api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        # give the audio file path to process directly to the mother class if exist
        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback
        self.key = kwargs.get('key', None)
        self.show_all = kwargs.get('show_all', False)

        # start listening in the background
        self.set_callback(self.wit_callback)
        # start processing, record a sample from the microphone if no audio file path provided, else read the file
        self.start_processing()
Example #7
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with Houndify api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        SpeechRecognition.__init__(self)

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback
        self.client_id = kwargs.get('client_id', None)
        self.key = kwargs.get('key', None)
        # only english supported
        # self.language = kwargs.get('language', "en-US")
        self.show_all = kwargs.get('show_all', False)

        # start listening in the background
        self.set_callback(self.houndify_callback)
        self.start_listening()
Example #8
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with google api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        # give the audio file path to process directly to the mother class if exist
        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback
        self.key = kwargs.get('key', None)
        self.language = kwargs.get('language', "en-US")
        self.show_all = kwargs.get('show_all', False)

        # set the callback that will process the audio stream
        self.set_callback(self.google_callback)
        # start processing, record a sample from the microphone if no audio file path provided, else read the file
        self.start_processing()
Example #9
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with CMU sphinx api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        # give the audio file path to process directly to the mother class if exist
        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback
        self.language = kwargs.get('language', "en-US")
        self.keyword_entries = kwargs.get('keyword_entries', None)
        # ge the grammar file if exist
        self.grammar_file = kwargs.get('grammar_file', None)

        # start listening in the background
        self.set_callback(self.sphinx_callback)
        # start processing, record a sample from the microphone if no audio file path provided, else read the file
        self.start_processing()
Example #10
0
    def __init__(self, callback=None, **kwargs):
        """
        Start recording the microphone and analyse audio with Houndify api
        :param callback: The callback function to call to send the text
        :param kwargs:
        """
        # give the audio file path to process directly to the mother class if exist
        SpeechRecognition.__init__(self, kwargs.get('audio_file_path', None))

        # callback function to call after the translation speech/tex
        self.main_controller_callback = callback
        self.client_id = kwargs.get('client_id', None)
        self.key = kwargs.get('key', None)
        # only english supported
        # self.language = kwargs.get('language', "en-US")
        self.show_all = kwargs.get('show_all', False)

        # start listening in the background
        self.set_callback(self.houndify_callback)
        # start processing, record a sample from the microphone if no audio file path provided, else read the file
        self.start_processing()