Logo

Murf

Orate supports Murf's speech services.

Murf is a leading provider of AI services, offering a wide range of speech services through their Large Language Models (LLMs). Orate allows you to use these services with a single API, making it easy to switch between providers and use the best AI services for your needs.

Setup

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

import { Murf } from 'orate/murf';

Configuration

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

const murf = new Murf();

This will use the MURF_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 murf = new Murf('your_api_key');

Usage

The Murf provider provides a single interface for all of Murf's speech services.

Text to Speech

The Murf provider provides a tts function that allows you to create a text-to-speech synthesis function using Murf's TTS. By default, the tts function uses the GEN2 model and the en-US-natalie voice.

import { speak } from 'orate';
import { Murf } from 'orate/murf';
 
const speech = await speak({
  model: new Murf().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 Murf().tts('GEN1', 'en-AU-joyce'),
  prompt: 'Hello, world!',
});

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

const speech = await speak({
  model: new Murf().tts('GEN1', 'en-AU-joyce', {
    pitch: 25,
  }),
  prompt: 'Hello, world!',
});

On this page