Logo

LMNT

Orate supports LMNT's speech services.

LMNT is a platform that offers multimodal models that create natural speech in any language, voice, style, and emotion, enabling real-time interaction in any setting. Orate allows you to use LMNT's models to create text-to-speech and speech-to-speech synthesis.

Setup

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

import { lmnt } from 'orate/lmnt';

Configuration

The LMNT provider looks for the LMNT_API_KEY environment variable. This variable is required for the provider to work. Simply add the following to your .env file:

LMNT_API_KEY="your_api_key"

Usage

The LMNT provider provides a single interface for all of LMNT's speech and transcription services.

Text to Speech

The LMNT provider provides a tts function that allows you to create a text-to-speech synthesis function using LMNT. By default, the tts function uses the aurora model and the lily voice.

import { speak } from 'orate';
import { lmnt } from 'orate/lmnt';
 
const speech = await speak({
  model: lmnt.tts(),
  prompt: 'Hello, world!',
});

You can specify the model and voice to use by passing them as arguments to the tts function.

const speech = await speak({
  model: lmnt.tts('blizzard', 'zeke'),
  prompt: 'Hello, world!',
});

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

const speech = await speak({
  model: lmnt.tts('blizzard', 'zeke', {
    speed: 1.2,
  }),
  prompt: 'Hello, world!',
});

Speech to Speech

The LMNT provider provides a sts function that allows you to change the voice of the audio. By default, the sts function uses the lily voice.

import { change } from 'orate';
import { lmnt } from 'orate/lmnt';
 
const speech = await change({
  model: lmnt.sts(),
  audio: new File([], 'test.mp3', { type: 'audio/mp3' }),
});

You can specify the voice to use by passing it as an argument to the sts function.

const speech = await change({
  model: lmnt.sts('zeke'),
  audio: new File([], 'test.mp3', { type: 'audio/mp3' }),
});

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

const speech = await change({
  model: lmnt.sts('zeke', {
    language: 'de',
  }),
  audio: new File([], 'test.mp3', { type: 'audio/mp3' }),
});

On this page