BigJ64 / tiktok-voice

Simple Python script to interact with the TikTok TTS API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TikTok Text-to-speech API

This is a simple Python program that accesses the TikTok API and gives you an .mp3 file with what it says in the specified voice.

If you are stuck and need assistance, please ask me in my Discord server in #tiktok-voice (quickest response) or via the Issues tab.

If you like this project, feel free to support me via buymeacoffee!

NOTICE - TENOR AND ALTO

You may have noticed that there are 2 new voices on the TikTok platform as of yesterday, named Tenor and Alto. I haven't looked into them just yet but I will try to at another point. Due to the fact that the voices 'sing', it might require more work, so I cannot promise it to be supported soon. On another note, the Narrator voice has not been added, and we are working on finding it shortly. Finally, we need your help! There are so many more voices on the TikTok platform that we don't know about! Please let us know if you find one either via the Voices issue or the Discord server!

Usage

To use this, you need Python 3.8+ and all of the required packages installed.

To install required packages, run pip3 install playsound requests

Read from file

  1. Make sure you have your text in plaintext. You can name it anything
  2. Run py main.py -v VOICE -f FILENAME.txt (see voices below)

There is no character limit, though only latin characters are supported.

Read from argument

  1. Run py main.py -v VOICE -t TEXT -n FILENAME.mp3 (see voices below)

This has a 200 character limit, but you can have non-latin characters (as long as it has a TTS supported voice)

Play from text

Optionally, if you want to listen to the file instead of saving to a file, you can use the -p argument to play directly and then delete. If you get error 263, ignore it, it doesn't affect the program itself.

Voice Options

Since the list has gotten quite large, I have moved it to codes.md

Languages Supported:

  • Portuguese (Brazil)
  • German
  • English (Australia)
  • English (United Kingdom)
  • English (United States)
  • English (Disney)
  • Spanish
  • Spanish (Mexico)
  • French
  • Indonesian
  • Japanese
  • Korean

Samples

You can find samples of all the voices in /samples/

Credits

  • Spotlight for giving me the idea for this program
  • Myself for creating this
  • scanlime for giving the voice options
  • Komfudo for translating the sample text to German
  • Philemax for translating the sample text to French
  • Ash for adding command line arguments
  • BigJ64 for adding a play argument

About

Simple Python script to interact with the TikTok TTS API


Languages

Language:Python 100.0%