Skip to content

Latest commit

 

History

History
76 lines (52 loc) · 2.51 KB

File metadata and controls

76 lines (52 loc) · 2.51 KB

Text-to-Speech | C# Quickstart

Jumpstart your development with Hume's OCTAVE TTS API!

Overview

This project demonstrates how to use Hume AI's OCTAVE TTS API with C#.

Unlike conventional TTS that merely "reads" words, Octave is a speech-language model that understands what words mean in context, unlocking a new level of expressiveness. It acts out characters, generates voices from prompts, and takes instructions to modify the emotion and style of a given utterance.

See the Quickstart guide for a detailed explanation of the code in this project.

Instructions

  1. Clone this examples repository:

    git clone https://github.com/humeai/hume-api-examples
    cd hume-api-examples/tts/tts-csharp-quickstart
  2. Set up your API key:

    You must authenticate to use the Hume TTS API. Your API key can be retrieved from the Hume AI platform. For detailed instructions, see our documentation on getting your api keys.

    To set your API key as an environment variable: create a .env file in the example folder and past your API key there (HUME_API_KEY=""), or run this:

    Windows (Command Prompt):

    set HUME_API_KEY=your_api_key_here

    Windows (PowerShell):

    $env:HUME_API_KEY="your_api_key_here"

    macOS/Linux:

    export HUME_API_KEY=your_api_key_here
  3. Install dependencies:

    dotnet restore
  4. Run the project:

    dotnet run

Features Demonstrated

This quickstart demonstrates several key features of the Hume TTS API:

  • Voice Generation: Creating a new voice from a text description
  • Voice Library: Saving and reusing custom voices
  • Context Continuation: Maintaining speech consistency across utterances
  • Acting Instructions: Modulating speech style and emotion
  • Streaming: Real-time audio generation for low-latency applications

Requirements

  • .NET 8.0 or later
  • A Hume API key

Output

The application will generate several audio files in a temporary directory and demonstrate streaming functionality. Check the console output for the location of generated audio files.