Unofficial Python3 API for https://fifteen.ai/
15.ai TOS explicitly states that:
- Website (and the content generated with it) is intended for strictly non-commercial use.
- If you want to publish the generated content online, you should include a citation (simply including 15.ai is sufficient).
These are simple rules, please follow them. Don't be that guy.
Refer to About and FAQ for more info.
Keep in mind that the 15.ai is constantly changing and improving, and this script may and eventually will break and will require updating. If it does not work, create issue, or, even better, pull request to fix that.
Requires python >= 3.6
Note: on Windows, in this and the following commands instead of python3
, you may want to use python
Install dependencies
python3 -m pip install requests
Grab the fifteen_api.py
and throw it where you want to use it.
You can use fifteen_api.py
as executable in terminal. Launch it with
python3 fifteen_api.py
You will get a list of characters and their available emotions, and you can Visit https://fifteen.ai/app, find the character's name and the suitable emotion, and use them right there to get your text-to-speech dreams come true as .wav files. (WARNING: Character's name and emotions are case sensitive! You'll get a server error if you type them in incorrectly.)
Suppose you put fifteen_api.py
next to the file in which you want to use it:
from fifteen_api import FifteenAPI
tts_api = FifteenAPI()
Alternatively, to get verbose output:
tts_api = FifteenAPI(show_debug=True)
tts_api.save_to_file("Fluttershy", "Neutral", "This is a test text", "my_tts_file.wav")
Alternatively, to automatically generate a unique file name
tts_api.save_to_file("Fluttershy", "Neutral", "This is a test text")
Example output on successful request:
{'status': 'OK', 'filename': '15ai-Fluttershy-Thisisatestte-1588057995.wav'}
Example output on failed request:
{'status': 'Reason_why_it_failed', 'filename': None}
response = tts_api.get_tts_raw("Fluttershy", "Neutral", "This is a test text")
Example output on successful request:
{'status': 'OK', 'data': b'th3r3g03sy0urbyt3s'}
Example output on failed request:
{'status': 'Reason_why_it_failed', 'data': None}