Links
Comment on page

Using PIP Python Package

iApp Technology just released a PIP Python Package on Thai Text-To-Speech.
For easing the python development using iApp AI API service, we have released the iapp_ai python pip package. It is the api client library for iApp AI API service for python.

Installation

$ pip install iapp_ai
Note: It can be either pip or pip3 depend on your environment.

Calling Thai TTS API

  • Kaitom Voice
# Kaitom ThaiTTS API required a text
text = "สวัสดี สบายดีไหม ทานข้าวหรือยังครับ"
api.thai_thaitts_kaitom(text).content
  • Cee Thai Celebrity Voice
# Cee ThaiTTS API required a text
text = "สวัสดี เสียงซีสังเคราะห์ ก็มาแล้วค่า"
api.thai_thaitts_cee(text).content

Example Usages

import iapp_ai
# You can request API key at https://ai.iapp.co.th
apikey = 'XXXXX_Your_API_Key_XXXXX'
api = iapp_ai.api(apikey)
# Kaitom ThaiTTS API required a text
text = "สวัสดี สบายดีไหม ทานข้าวหรือยังครับ"
with open("kaitom.mp3", "wb") as f:
f.write(api.thai_thaitts_kaitom(text).content)
# Cee ThaiTTS API required a text
text = "สวัสดี เสียงซีสังเคราะห์ ก็มาแล้วค่า"
with open("cee.mp3", "wb") as f:
f.write(api.thai_thaitts_cee(text).content)
# audio file: kaitom.mp3 and cee.mp3 will be saved

Full Example in Google Colaboratory

Google Colaboratory
Full Example of iApp AI API in Google Colaboratory