Lots of changes since June! Summary below. Get all of these and more with a quick pip install --upgrade SpeechRecognition
.
- Snowboy hotwords support for highly efficient, performant listening (thanks @beeedy!). This is implemented as the
snowboy_configuration
parameter ofrecognizer_instance.listen
. - Configurable Pocketsphinx models - you can now specify your own acoustic parameters, language model, and phoneme dictionary, using the
language
parameter ofrecognizer_instance.recognize_sphinx
(thanks @frawau!). audio_data_instance.get_segment(start_ms=None, end_ms=None)
is a new method that can be called on any AudioData instance to get a segment of the audio starting atstart_ms
and ending atend_ms
. This is really useful when you want to get, say, only the first five seconds of some audio.- The
stopper
function returned bylisten_in_background
now accepts one parameter,wait_for_stop
(defaulting toTrue
for backwards compatibility), which determines whether the function will wait for the background thread to fully shutdown before returning. One advantage is that ifwait_for_stop
isFalse
, you can call thestopper
function from any thread! - New example, demonstrating how to simultaneously listen to and recognize speech with the threaded producer/consumer pattern: threaded_workers.py.
- Various improvements and bugfixes:
- Python 3 style type annotations in library documentation.
recognize_google_cloud
now uses the v1 rather than the beta API (thanks @oort7!).recognize_google_cloud
now returns timestamp info when theshow_all
parameter isTrue
.recognize_bing
won't time out as often on credential requests, due to a longer default timeout.recognize_google_cloud
timeouts respectrecognizer_instance.operation_timeout
now (thanks @reefactor!).- Any recognizers using FLAC audio were broken inside Linux on Docker - this is now fixed (thanks @reefactor!).
- Various documentation and lint fixes (thanks @josh-hernandez-exe!).
- Lots of small build system improvements.