You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performs speech recognition on ``audio_data`` (an ``AudioData`` instance), using CMU Sphinx.
413
411
414
-
The recognition language is determined by ``language``, an IETF language tag like ``"en-US"`` or ``"en-GB"``, defaulting to US English. A list of supported language codes can be found `here <http://stackoverflow.com/questions/14257598/>`__. Basically, language codes can be just the language (``en``), or a language with a dialect (``en-US``). ;wip
412
+
The recognition language is determined by ``language``, an IETF language tag like ``"en-US"`` or ``"en-GB"``, defaulting to US English. By default, only ``en-US`` is supported. Additional languages can be installed from ;wip
415
413
416
414
Returns the most likely transcription if ``show_all`` is false (the default). Otherwise, returns the Sphinx ``pocketsphinx.pocketsphinx.Hypothesis`` object generated by Sphinx.
417
415
418
416
Raises a ``speech_recognition.UnknownValueError`` exception if the speech is unintelligible. Raises a ``speech_recognition.RequestError`` exception if there are any issues with the Sphinx installation.
419
417
"""
420
418
assertisinstance(audio_data, AudioData), "`audio_data` must be audio data"
421
-
assertisinstance(language, str), "`language` must be a string"#wip: do this properly
419
+
assertisinstance(language, str), "`language` must be a string"
422
420
423
421
# import the PocketSphinx speech recognition module
raw_data=audio_data.get_raw_data(convert_rate=16000, convert_width=2) # Sphinx requires audio to be 16-bit mono 16 kHz in little-endian format
450
+
raw_data=audio_data.get_raw_data(convert_rate=16000, convert_width=2) # the included language models require audio to be 16-bit mono 16 kHz in little-endian format
0 commit comments