speech_design

Generate Speech with Designed Voice

Description

Create a voice from a natural language description and generate speech. This endpoint requires the qwen3-tts-api backend with the voice design model.

Usage

1speech_design(input, voice_description, file = NULL, language = "English")

Arguments

  • input: Character. The text to convert to speech.
  • voice_description: Character. Natural language description of the desired voice (e.g., “A warm, friendly female voice with a slight British accent”).
  • file: Character or NULL. Output file path. If NULL, returns raw bytes.
  • language: Character. Language for synthesis. Supported: Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian.

Details

This function uses the /v1/audio/speech/design endpoint which is specific to qwen3-tts-api. It requires the VoiceDesign model to be loaded (loaded on first use).

Value

If file is provided, invisibly returns the file path. If file is NULL, returns raw audio bytes.

Examples

 1set_tts_base("http://localhost:7811")
 2
 3# Generate speech with a custom designed voice
 4speech_design(
 5  input = "Hello, I am your AI assistant.",
 6  voice_description = "A professional male voice, clear and authoritative",
 7  file = "assistant.wav"
 8)
 9
10# Playful voice
11speech_design(
12  input = "Let's have some fun!",
13  voice_description = "An energetic young female voice, cheerful and playful",
14  file = "playful.wav"
15)