Releases: KoljaB/RealtimeTTS
Releases · KoljaB/RealtimeTTS
v0.4.51
RealtimeTTS v0.4.51 Release Notes
- added on_word callback to TextToAudioStream that gets called when a word gets played out
Supported by AzureEngine and english voices of KokoroEngine.
An instance of class TimingInfo from BaseEngine.py gets submitted as parameter. It carries the members word, start_time and end_time. For examples please look into tests/kokoro_test.py and tests/azure_test.py
WordTimings.mp4
v0.4.50
RealtimeTTS v0.4.50 Release Notes
- added possibility to mix voices for KokoroEngine:
engine.set_voice("0.714*af_nicole + 0.286*af_sky")
This feature allows you to mix a custom voice. You can use 🛠️ this tool and copy/paste the voice combination formula.
📝 Code to test voice mixing mixing voices with Kokoro
v0.4.49
v0.4.48
v0.4.47
v0.4.46
v0.4.43
v0.4.42
RealtimeTTS v0.4.42 Release Notes
- KokoroEngine can now be installed with
pip install RealtimeTTS[kokoro]
(does not need external installation anymore) - supports Kokoro-V1.0
- support for more voices
v0.4.41
RealtimeTTS v0.4.41 Release Notes
New Feature: KokoroEngine Support
-
KokoroEngine Integration
- Introduces support for the Kokoro 82M TTS engine.
- Provides access to a variety of Kokoro voice models.
-
Installation:
pip install realtimetts[all]==0.4.41
-
Setup Resources:
- Kokoro installation guide: Kokoro Installation
- Test script: kokoro_test.py
- Engine implementation: kokoro_engine.py
Usage Overview
from RealtimeTTS import TextToAudioStream, KokoroEngine
# Initialize Kokoro engine
engine = KokoroEngine(kokoro_root="path/to/Kokoro-82M")
# Switch voice as needed
engine.set_voice("af_sky")
# Create audio stream
stream = TextToAudioStream(engine)
# Feed and play audio using Kokoro voices
stream.feed("Hello world")
stream.play()
v0.4.40
RealtimeTTS v0.4.4 Release Notes
Configurable Playback Parameters
New Parameters: frames_per_buffer
and playout_chunk_size
-
Purpose:
- These new parameters provide finer control over audio playback buffering, which is especially useful for mitigating stuttering issues on Unix-based systems.
-
Details:
-
frames_per_buffer
:- Controls the number of audio frames processed per buffer by PyAudio.
- Lower values reduce latency but increase CPU usage, while higher values reduce CPU load but increase latency.
- Recommended Settings for Stuttering:
- Start by setting
frames_per_buffer
to256
. - If issues persist, reduce it further to
128
.
- Start by setting
Example:
stream = TextToAudioStream(engine, frames_per_buffer=256)
-
playout_chunk_size
:- Specifies the size (in bytes) of audio chunks played out to the stream.
- Works in conjunction with
frames_per_buffer
to optimize audio smoothness. - Defaults to dynamic calculation, but can be explicitly set for precise control.
Example:
stream = TextToAudioStream(engine, playout_chunk_size=1024)
-
How These Parameters Address Stuttering:
- On Unix systems, default buffer sizes may cause sporadic stuttering during audio playback due to timing mismatches between the audio stream and system audio drivers.
- By reducing
frames_per_buffer
to256
or128
, the playback becomes more responsive and better aligned with system timing. - Adjusting
playout_chunk_size
further enhances playback smoothness by ensuring optimal chunk delivery to the audio stream.
Usage Examples
Basic Configuration:
from RealtimeTTS import TextToAudioStream, PiperEngine
engine = PiperEngine(piper_path="path/to/piper.exe", voice=my_voice)
stream = TextToAudioStream(
engine=engine,
frames_per_buffer=256, # Start with 256 to reduce stuttering
playout_chunk_size=1024 # Optional for further customization
)
stream.play()
Fine-Tuning for Stuttering:
- If playback issues occur:
- Set
frames_per_buffer
to256
(recommended starting point). - Reduce to
128
if stuttering persists. - Optionally adjust
playout_chunk_size
to a fixed value like1024
or512
.
- Set
- Backward Compatibility:
- Defaults for
frames_per_buffer
andplayout_chunk_size
maintain compatibility with previous versions, requiring no changes for existing setups unless adjustments are needed.
- Defaults for