【发布时间】:2018-08-23 17:29:31
【问题描述】:
我正在通过 gTTS (Google Text-to-Speech) 创建 mp3 文件,它是一个 Python 库和 CLI 工具,用于与 Google Translate 的文本到语音 API 进行交互。如何将图像添加到 mp3 文件。谢谢
from mp3_tagger import MP3File, VERSION_1, VERSION_2, VERSION_BOTH
from gtts import gTTS
start = "Hello,this is Alice ."
greetings ="That is the end of the news for today. Have a good day. "
final_news = start + greetings
tts = gTTS(text=final_news, lang='en')
tts.save("news1.mp3")
# Create MP3File instance.
mp3 = MP3File('news1.mp3')
# Get all tags.
tags = mp3.get_tags()
print tags
输出如下: {'ID3TAGV1':{“专辑”:U'Uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 'Bebop','歌曲':u'UUUUUUUUUUUUUUUUUUUUUUUUUUUU\u044f','年份':u'UUUU'},'ID3TagV2':{}}
现在我想添加图像,以便在播放文件时对其进行透析。
【问题讨论】:
-
请分享您的代码,以便我们从某个地方开始。
-
python 版本:2.7.12。代码显示在上面。
标签: mp3 text-to-speech