2
2

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.

Google Text To Speakでテキスト読み上げ機能で音声ファイルを作って3分間スピーチの目安の文章を確かめる

Last updated at Posted at 2020-02-01

Google Text To Speakでテキスト読み上げ
て大まかなスピーチ時間を測る方法。
最近3分間スピーチをしなくてはいけなくて原稿が大まかにどの位の読み上げ時間をかかるか調べる必要があったので記事を書きました。
まずターミナルで

で音声読み上げのパッケージを入れて文章を記載したhello.txtを読み上げ機能でmp3ファイルを作ります。
ファイルは全体の時間情報を持っているので(音楽アプリで何分って表示されますよね)
3分スピーチの原稿の大まかな読み上げ時間を確認出来ます。


from gtts import gTTS

f = open('hello.txt','r',encoding="utf-8")
data1 = f.read()  # ファイル終端まで全て読んだデータを返す
f.close()
tts = gTTS(text=data1, lang='ja')
tts.save("good.mp3")
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?