1. Get started

  1. Visit Pricing and select a plan
  2. For 500,000 free migration credits, email support@lmnt.com with “Migrated from PlayHT to LMNT” and your last PlayHT billing statement

2. Install SDK

pip install -U lmnt
For Unity, see the Unity SDK guide.

3. Update your code

Here’s how to convert your PlayHT code to LMNT.

PlayHT Code

from pyht import Client
from dotenv import load_dotenv
from pyht.client import TTSOptions, Format
import os
load_dotenv()

client = Client(
   user_id="PlayHT user id",
   api_key="PlayHT API key",
 )
options= TTSOptions(voice="s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json", format=Format.FORMAT_MP3)
with open("/Users/yourname/Downloads/audio.mp3", mode='wb') as f:
 for chunk in client.tts("Hello world!", options):
     f.write(chunk)

LMNT Code

import asyncio
from lmnt import AsyncLmnt

text = 'Hello world!'
voice_id = 'leah'
language = 'en'

async def main():
  client = AsyncLmnt()
  response = await client.speech.generate(
    text=text,
    voice=voice_id,
    language=language,
  )
  with open('audio.mp3', 'wb') as f:
    f.write(await response.read())

asyncio.run(main())

4. Choose voices

Select from our stock voices or create custom voice clones in the Playground. List all available voices:
import asyncio
from lmnt import AsyncLmnt

async def main():
  client = AsyncLmnt()
  voices = await client.speech.list_voices()
  name_id_list = [(voice.name, voice.id) for voice in voices]

  for name, id_ in name_id_list:
    print(f"Name: {name} | ID: {id_}")

asyncio.run(main())

Need help?

  • Voice transfer: Email support@lmnt.com for assistance with specific voice migrations
  • Documentation: Check our guides for optimization tips