Logo

Lemonfox

Orate supports Lemonfox's speech and transcription services.

Lemonfox is an easy to use text-to-speech and speech-to-text provider.

Setup

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

import { Lemonfox } from 'orate/lemonfox';

Configuration

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

const lemonfox = new Lemonfox();

This will use the LEMONFOX_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 lemonfox = new Lemonfox('your_api_key');

Usage

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

Text to Speech

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

The first argument is the language of the text to be spoken. The second argument is the voice to use.

In Lemonfox, the voices are tied to a specific language. For example, the sarah voice is only available for the en-us language.

import { speak } from 'orate';
import { Lemonfox } from 'orate/lemonfox';
 
const speech = await speak({
  model: new Lemonfox().tts('en-us', 'sarah'),
  prompt: 'Hello, world!',
});

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

const speech = await speak({
  model: new Lemonfox().tts('en-us', 'sarah', {
    speed: 1.5,
  }),
  prompt: 'Hello, world!',
});

Speech to Text

The Lemonfox provider provides a stt function that allows you to create a speech-to-text transcription function using Lemonfox STT.

import { transcribe } from 'orate';
import { Lemonfox } from 'orate/lemonfox';
 
const text = await transcribe({
  model: new Lemonfox().stt(),
  audio: new File(...),
});

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

const text = await transcribe({
  model: new Lemonfox().stt({
    speaker_labels: true,
  }),
  audio: new File(...),
});

On this page