API Reference
adafruit_picotts
Text to speech for CircuitPython using the SVOX Pico engine by SVOX AG (Apache-2.0).
The engine is a native .mpy (picotts_native.<arch>.mpy) and the en-US voice ships in
the package, so it runs on stock CircuitPython 11. It needs a board with PSRAM: about 2.5 MB of
RAM for the voice and the engine.
Software and Dependencies:
Adafruit CircuitPython firmware 11 or later for the supported boards: https://circuitpython.org/downloads
- class adafruit_picotts.TTS(audio)
Speak text through an audio output.
- Parameters:
audio – An audio output object with
play(),stop()andplaying, such asaudiobusio.I2SOut,audioio.AudioOutoraudiopwmio.PWMAudioOut. The library creates its ownaudiomixer.Mixeron it. Or anaudiomixer.MixerVoicefrom the caller’s mixer, whose sample rate must matchsample_rate.
- deinit() None
Stop speaking and release the engine and the mixer this object created. The audio output and a caller’s mixer are not deinitialized; the caller owns them.
- say(text: str, *, wait: bool = True, interrupt: bool = False) None
Speak
text. If speech is already playing,textis queued after it.