Logo

Hume

Orate supports Hume's text-to-speech services.

Hume is a LLM for text-to-speech synthesis, allowing you to generate realistic speech with unique voices. Orate allows you to use this service with a single API.

Setup

The Hume provider is available by default in Orate. To import it, you can use the following code:

import { Hume } from 'orate/hume';

Configuration

You can use Hume by creating a new instance of the Hume class:

const hume = new Hume();

This will use the HUME_API_KEY environment variable. If you don't have this variable set, you can pass your API key as an argument to the constructor.

const hume = new Hume('your_api_key');

Usage

The Hume provider provides a single interface for all of Hume's text-to-speech services.

Text to Speech

The Hume provider provides a tts function that allows you to create a text-to-speech synthesis function using Hume TTS.

Hume is unique in that it allows you to describe the voice you want to use in natural language. For example:

import { speak } from 'orate';
import { Hume } from 'orate/hume';
 
const speech = await speak({
  model: new Hume().tts('A medieval knight'),
  prompt: 'Hello, world!',
});

If you have a voice saved in your library, you can use the voice's name to describe it.

const speech = await speak({
  model: new Hume().tts('A medieval knight', 'voice_id'),
  prompt: 'Hello, world!',
});

You can also specify specific Hume properties by passing them as an argument to the tts function.

const speech = await speak({
  model: new Hume().tts('A medieval knight', 'voice_id', {
    numGenerations: 3,
  }),
  prompt: 'Hello, world!',
});

On this page