Rime
The RimeTTSService provides high-fidelity, low-latency text-to-speech using Rime's WebSocket API. It supports advanced features like inline speed control and specialized spelling modes.
Installation
pip install "piopiy-ai[rime]"
Prerequisites
- A Rime API key (Get yours here).
- Set your API key in your environment:
export RIME_API_KEY="your_api_key_here"
Configuration
RimeTTSService Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | Required | Your Rime API key. |
voice_id | str | Required | ID of the voice to use. |
model | str | "mistv2" | Model ID for synthesis. |
params | InputParams | InputParams() | Synthesis settings. |
InputParams
| Parameter | Type | Default | Description |
|---|---|---|---|
language | Language | Language.EN | Language for synthesis. |
speed_alpha | float | 1.0 | Speed multiplier. |
reduce_latency | bool | False | Optimize for speed over quality. |
Usage
Basic Setup
import os
from piopiy.services.rime.tts import RimeTTSService
tts = RimeTTSService(
api_key=os.getenv("RIME_API_KEY"),
voice_id="marcia"
)
Notes
- Word Timestamps: Rime provides precise word-level timing information, which is used for lip-sync and progress tracking.
- Special Functions: Supports
SPELL(text)for spelling out words andPAUSE_TAG(seconds)for inserting pauses. - Alternative Endpoints: For models like Arcana, use
RimeNonJsonTTSService.