Skip to main content

A Voicemaker.in simple API interface

Project description

Voicemaker

Voicemaker.in is an online text-to-speech service with a dead-simple API. This package is just a wrapper around their API.

This is an unofficial package, and is in no way associated to Voicemaker.

The official API documentation is here: https://developer.voicemaker.in/apidocs

Latest API supported version

The lastest API supported version is the v2.2.

Prerequisites

The only thing you will need is your API token, which you can obtain in the official API documentation page once you log in.

Usage

List all available voices for a language

from voicemaker import Voicemaker

vm = Voicemaker()
vm.list_voices(language="en-US")

Which returns an array of dict elements with the following structure:

[
  {
    "Engine": "neural",
    "VoiceId": "ai1-Joanna",
    "VoiceGender": "Female",
    "VoiceWebname": "Joanna",
    "Country": "US",
    "Language": "en-US"
  },
  ...
]

Generate URL for text

from voicemaker import Voicemaker

vm = Voicemaker()
vm.set_token('<TOKEN>')
vm.generate_audio_url('I met a traveller from an antique land Who said: Two vast and trunkless legs of stone Stand in the desert.')

Returns the URL of the generated voice in MP3 format.

Also accepts the following optional arguments:

text (str): Text to generate an audio from.
engine (str, optional): Choose between 'standard' and 'neutral'. Defaults to 'neural'.
voice_id (str, optional): Uses the selected voice id from the available one for the selected language. Defaults to 'ai3-Jony'.
language_code (str, optional): Language of the target voice. Defaults to 'en-US'.
output_format (str, optional): Choose from 'mp3' and 'wav'. Defaults to 'mp3'.
sample_rate (int, optional): Choose from 48000, 44100, 24000, 22050, 16000, 8000. Defaults to 48000.
effect (str, optional): Effect to give to the voice. Defaults to 'default'.
master_speed (int, optional): Speed from -100 to 100. Defaults to 0.
master_volume (int, optional): Volume of the voice from -100 to 100. Defaults to 0.
master_pitch (int, optional): Pitch of the voice, from -100 to 100. Defaults to 0.

Save generated audio to disk

This is a convenience method. It just calles generate_audio_url, gets the URL, downloads the file and saves it to disk.

from voicemaker import Voicemaker

vm = Voicemaker()
vm.set_token('<TOKEN>')
vm.generate_audio_to_file('test.mp3', 'I met a traveller from an antique land Who said: Two vast and trunkless legs of stone Stand in the desert.')

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

voicemaker-0.0.7.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voicemaker-0.0.7-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file voicemaker-0.0.7.tar.gz.

File metadata

  • Download URL: voicemaker-0.0.7.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for voicemaker-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ff83c2f9d77e50ed7336b736ba48c377cb4920dcffcc46657a00855de9c1fdca
MD5 4b011ec048d069c98ccc1ec9a5a85502
BLAKE2b-256 2c82bdfe791a1bad02ecad956d7fff2773bd8ac64ba89ef618fd1c2aedf6ec96

See more details on using hashes here.

File details

Details for the file voicemaker-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: voicemaker-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for voicemaker-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 98d67f55fd8bbfa9050f98494694ba3c2c7c26311221b0ac3b6a1ee4bd6484c8
MD5 59ab5c8800c7f43716cc846a491edb7e
BLAKE2b-256 a2535b3d059bcf8656a422ae7ede7aa8a84b978dd1aa9d15437831c5668e85fe

See more details on using hashes here.

Supported by

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