β¬οΈ Lots of changes since June! Summary below. Get all of these and more with a quick pip install --upgrade SpeechRecognition.
snowboy_configuration parameter of recognizer_instance.listen.language parameter of recognizer_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 at start_ms and ending at end_ms. This is really useful when you want to get, say, only the first five seconds of some audio.stopper function returned by listen_in_background now accepts one parameter, wait_for_stop (defaulting to True for backwards compatibility), which determines whether the function will wait for the background thread to fully shutdown before returning. One advantage is that if wait_for_stop is False, you can call the stopper function from any thread!recognize_google_cloud now uses the v1 rather than the beta API (thanks @oort7!).recognize_google_cloud now returns timestamp info when the show_all parameter is True.recognize_bing won't time out as often on credential requests, due to a longer default timeout.recognize_google_cloud timeouts respect recognizer_instance.operation_timeout now (thanks @reefactor!).β¬οΈ As usual, get it with pip install --upgrade SpeechRecognition
grammar parameter for recognizer_instance.recognize_sphinx - now, you can specify a JSGF or FSG grammar to PocketSphinx (thanks @aleneum!).urllib.request behavior made requests fail in certain situations.π Quick bugfix for PortableNamedTemporaryFile:
π Bugfix release!
tempfile.NamedTemporaryFile on Windows, by replacing it with a PortableNamedTemporaryFile class. Previously, it didn't necessarily support the file being re-opened after originally opened.phrase_time_limit being ignored for listen_in_background (thanks @dodysw!)π Small bugfix release:
π This is more of a maintenance release, but a few features slipped in as well:
recognizer_instance.recognize_google_cloud (thanks @Thynix!), plus documentation and examples.speech_recognition.Microphone - this should fully resolve all the "Invalid sample rate" issues from PyAudio.recognizer_instance.recognize_sphinx.EOFError upon encountering malformed audio files; a proper exception message is now given.recognizer_instance.recognize_houndify (thanks @tb0hdan!).recognize_sphinx now supports keyword-based matching via the keywords=[("cat", 30), ("potato", 45)] parameter.
recognize_api function will keep working if you're on a paid API.AI plan, and we will not be removing it until the service is shut down entirely.phrase_time_limit option for listening functions, to limit phrase lengths to a certain number of seconds.recognizer_instance.operation_timeout - this can be used to ensure long requests always take finite time.recognize_ibm now opts out of request logging by default, for improved user privacy (thanks @michellemorales!). This is a breaking change if you previously relied on request logging behaviour.listen() sometimes didn't terminate on finite-length streams.π Bugfix release.
π Changes:
sessionId field, so we'll just add that in (thanks @jhoelzl!).