0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gTTS で日本語の発話 (テキストファイルの読み上げ)

0
Last updated at Posted at 2020-11-01

こちらと同じことを gTTS で行ってみました。
OpenJtalk で日本語の発話 (テキストファイルの読み上げ)

kusamakura02.py
# ! /usr/bin/python
#
#	kusamakura02.py
#
#						Nov/01/2020
#
# --------------------------------------------------------------------
from gtts import gTTS
import sys
# --------------------------------------------------------------------
sys.stderr.write("*** 開始 ***\n")
file_in = sys.argv[1]
file_out = sys.argv[2]
#
fp_in = open(file_in,encoding='utf-8')
text_aa = fp_in.read()
fp_in.close()
#
tts = gTTS(text=text_aa, lang='ja')
tts.save(file_out)
sys.stderr.write("*** 終了 ***\n")
# --------------------------------------------------------------------

実行方法

./kusamakura02.py in01.txt out01.mp3
#
mpg321 out01.mp3
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?