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

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

const lmnt = new LMNT();

This will use the LMNT_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 lmnt = new LMNT('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: new 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: new 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: new 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: new 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: new 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: new LMNT().sts('zeke', {
    language: 'de',
  }),
  audio: new File([], 'test.mp3', { type: 'audio/mp3' }),
});

On this page