Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
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
- Configurable Pocketsphinx models - you can now specify your own acoustic parameters, language model, and phoneme dictionary, using the
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_msand ending at
end_ms. This is really useful when you want to get, say, only the first five seconds of some audio.
stopperfunction returned by
listen_in_backgroundnow accepts one parameter,
Truefor backwards compatibility), which determines whether the function will wait for the background thread to fully shutdown before returning. One advantage is that if
False, you can call the
stopperfunction 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_cloudnow uses the v1 rather than the beta API (thanks @oort7!).
recognize_google_cloudnow returns timestamp info when the
recognize_bingwon't time out as often on credential requests, due to a longer default timeout.
recognizer_instance.operation_timeoutnow (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.
As usual, get it with
pip install --upgrade SpeechRecognition
recognizer_instance.recognize_sphinx- now, you can specify a JSGF or FSG grammar to PocketSphinx (thanks @aleneum!).
- Update PyAudio to version 0.2.11 - this fixes a couple memory management issues users have been experiencing.
- Update FLAC to 1.3.2 on all platforms - this will make it easier to support more audio formats in the near future.
- Fixes for various APIs on Python 3.6+ - small changes in
urllib.requestbehavior made requests fail in certain situations.
- Fixes for Bing Speech API timing out due to some backwards incompatible changes to their API.
- Restore original IBM audio segmentation behaviour - previously, it would stop recognizing after the first pause. Now, it will recognize all speech in the input audio, as it did before IBM's changes.
- Fix links in PocketSphinx docs and library reference. Add-on language models now available from Google Drive, including the now-officially-supported Italian model.
- New troubleshooting entries for JACK server in README.
- Documentation and build process updates.
tempfile.NamedTemporaryFileon Windows, by replacing it with a
PortableNamedTemporaryFileclass. Previously, it didn't necessarily support the file being re-opened after originally opened.
- Documentation/troubleshooting improvements (thanks @hassanmian!).
- Add support for 24-bit FLAC audio files (thanks @sudevschiz!).
phrase_time_limitbeing ignored for
- Added lots of new audio regression tests.
- Code cleanup for tests and examples.
This is more of a maintenance release, but a few features slipped in as well:
- Support for the Google Cloud Speech API with
recognizer_instance.recognize_google_cloud(thanks @Thynix!), plus documentation and examples.
- Automatic sample rate detection in
speech_recognition.Microphone- this should fully resolve all the "Invalid sample rate" issues from PyAudio.
- Project now has automated tests and continuous integration with TravisCI. It's pretty nifty, and has already caught a few things during development!
- Keywords example for
- Documentation improvements and updated advice in troubleshooting and library reference.
- Bugfix - Google Speech Recognition sometimes didn't return the text with the highest confidence (thanks @akabraham!).
- Bugfix -
EOFErrorupon encountering malformed audio files; a proper exception message is now given.
- Updated FLAC binaries for OS X.
- Bugfix - invalid FLAC binary path on OS X (thanks @akabraham!).
- Code cleanup.
- Support for the Houndify API with
recognize_sphinxnow supports keyword-based matching via the
keywords=[("cat", 30), ("potato", 45)]parameter.
- The second number in each pair is the sensitivity, which determines how loosely Sphinx will interpret speech to be those keywords - higher numbers mean more false positives, while lower numbers mean a lower detection rate.
- A new example for keyword matching is now available.
- BREAKING CHANGE: API.AI STT API IS BEING SHUT DOWN SOON. (source)
- For now, the
recognize_apifunction 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.
- It is best to transition to another backend as soon as possible. I recommend Microsoft Bing Voice Recognition or Wit.ai for previous API.AI users.
- For now, the
phrase_time_limitoption for listening functions, to limit phrase lengths to a certain number of seconds.
- Support for operation timeouts with
recognizer_instance.operation_timeout- this can be used to ensure long requests always take finite time.
recognize_ibmnow 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.
- Bugfix -
listen()sometimes didn't terminate on finite-length streams.
- Bugfix - Microsoft Bing Voice Recognition changed their authentication API endpoint, so that required some small code updates (thanks @tmator!).
- Bugfix - 24-bit audio now works correctly on Python 2.
- Update Wit.ai API version from deprecated version.
- A bunch of documentation updates, fixes, and improvements.
- api.ai now requires the
sessionIdfield, so we'll just add that in (thanks @jhoelzl!).
- Improve documentation a bit.
- Various other small fixes.