【发布时间】:2018-06-06 12:14:21
【问题描述】:
尝试使用 gTTS 模块将文本转换为语音并保存为 wav 文件。
我的代码:
import gTTS
text = "This is my text in the saving folder"
tts = gTTS(text)
tts.save('sample.wav')
文件已保存,但当我检查文件信息时:
$ mediainfo sample.wav
General
Complete name : sample.wav
Format : MPEG Audio
File size : 15.8 KiB
Duration : 4 s 32 ms
Overall bit rate mode : Constant
Overall bit rate : 32.0 kb/s
FileExtension_Invalid : m1a mpa1 mp1 m2a mpa2 mp2 mp3
Audio
Format : MPEG Audio
Format version : Version 2
Format profile : Layer 3
Duration : 4 s 32 ms
Bit rate mode : Constant
Bit rate : 32.0 kb/s
Channel(s) : 1 channel
Sampling rate : 24.0 kHz
Compression mode : Lossy
Stream size : 15.8 KiB (100%)
为什么我得到不同的保存格式?
【问题讨论】:
标签: python python-3.x mpeg google-text-to-speech