Skip to main content

Rime 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

ParameterTypeDefaultDescription
api_keystrRequiredYour Rime API key.
voice_idstrRequiredID of the voice to use.
modelstr"mistv2"Model ID for synthesis.
paramsInputParamsInputParams()Synthesis settings.

InputParams

ParameterTypeDefaultDescription
languageLanguageLanguage.ENLanguage for synthesis.
speed_alphafloat1.0Speed multiplier.
reduce_latencyboolFalseOptimize 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 and PAUSE_TAG(seconds) for inserting pauses.
  • Alternative Endpoints: For models like Arcana, use RimeNonJsonTTSService.