Skip to main content

Python client library for the LMNT API

Project description

LMNT Python Library

The LMNT Python library provides convenient access to the LMNT API from applications written in the Python language.

[Documentation]

Installation

Installing from PyPI is the quickest way to get started:

pip install --upgrade lmnt

Install from source with:

python setup.py install

Getting started

The most common operation you'll perform is a synthesize request. Given some text and a voice, it will return an audio file that you can play back. Take a look at our documentation for a deeper dive into the SDK.

import asyncio

from lmnt.api import Speech


LMNT_API_KEY = ...  # fill in your API key here


async def main():
  async with Speech(LMNT_API_KEY) as speech:
    synthesis = await speech.synthesize('Hello, world.', voice='lily', format='wav')
    with open('output.wav', 'wb') as f:
      f.write(synthesis['audio'])


asyncio.run(main())

While you can provide an api_key argument, we recommend using python-dotenv to add LMNT_API_KEY="My API Key" to your .env file so that your API key is not stored in source control.

More examples

You can find more examples in the demo directory.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmnt-1.1.2.tar.gz (175.3 kB view details)

Uploaded Source

Built Distribution

lmnt-1.1.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file lmnt-1.1.2.tar.gz.

File metadata

  • Download URL: lmnt-1.1.2.tar.gz
  • Upload date:
  • Size: 175.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for lmnt-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1ef26185e6a11c1de0f93faa0832d647a1e90f3d074f128253248b7d1b40e17f
MD5 83176fa81939d9e48dee39635fab1f4b
BLAKE2b-256 fbd16cd5a088c9f738e8d6a2cad584c7118ed46fb156d38205131066157f19c8

See more details on using hashes here.

File details

Details for the file lmnt-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: lmnt-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for lmnt-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3567dc551bce74c55a65b5b388b32596ee22a4e633841b6f9be3379e4c0c3a36
MD5 ad2e23018a3eee657c4b034e936e9020
BLAKE2b-256 37c69b0fc869234a8825519168e164d77bb31c486917a1cd56ab4806ff4e96c5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page