/langdu-rust

Text To Speech (TTS) command-line tool using Azure Cognitive Services.

Primary LanguageRust

langdu-rust

Build

Text To Speech (TTS) command-line tool, powered by Azure Cognitive Services.

Prerequisites

  • Azure subscription.
  • Create a Speech resource in the Azure portal.
  • Get the Speech resource key and region.

Quick Start

Add the environment variables

export SPEECH_KEY=your-key
export SPEECH_REGION=your-region

Run the command to synthesize speech from your txt file, and save speech to mp3.

langdu sample.txt output.mp3

Synthesize a dialog

Follow this format in your input txt file to synthesize a dialog-style speech with different voices with multilingual support.

# sample.txt

[en-US-ElizabethNeural] What do you do?
^^^^^^^^^^^^^^^^^^^^^^^
[en-US-JasonNeural] What do I do? System architecture.
^^^^^^^^^^^^^^^^^^^
|
Any supported voice identifier