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.4.tar.gz (175.6 kB view details)

Uploaded Source

Built Distribution

lmnt-1.1.4-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lmnt-1.1.4.tar.gz
  • Upload date:
  • Size: 175.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for lmnt-1.1.4.tar.gz
Algorithm Hash digest
SHA256 fcb43a618a4df53e95a3b5a301b74ef623d7ff33cade965958c5143ced3a6488
MD5 9b4614be923d4d1123883b96bbbccf62
BLAKE2b-256 07d985c9e83682392488f793c3e51fe6cc60c9aa023b4e6148a9045e29461622

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lmnt-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for lmnt-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 78616495d67ca7b736d303daa41182507f6b9256bf724c292f9c0c331da7da66
MD5 d229f5d79a7502eaac00931be926377a
BLAKE2b-256 a5884680f91c6bff8c086adb35ab956387e58f14bad6d82af268808ad552d121

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