网络上沉浸式英语听力素材有限。正好最近调试 OpenAI 的全家桶。
就做个小系统: 100%用 OpenAI 的 API 生成英语听力素材。
成品效果:
Whisper 转录+ChatGPT4 润色+OpenAI TTS 生成英语听力素材(纯英语版)_哔哩哔哩_bilibili
Whisper 转录+ChatGPT4 润色+OpenAI TTS 生成英语听力素材(含中文语音版)_哔哩哔哩_bilibili
实现思路:
pytube
下载 YouTube 视频,并转成音频这里分享我用的 prompt ,使用时将<输入的信息>替换成 Whisper 转录后的文本:
prompt = """
润色以下演讲稿, 注意生成讲故事风格, 不要遗漏细节, 不要遗漏包括提问、举例、交流以及互动等任何信息。忽视文尾的 Thank you 。确保:每句话 8 到 13 个单词,每句话独立成行,不分段,形成格式'英文|中文':
例如:
输入:
All right, I'd like you to take a moment, think about a time when you were recently sick.
Try specifically to think of a time when, even though you weren't feeling all that great, you still felt well enough to get up out of bed, go about your day.
The language I'm speaking right now is on its way to becoming the world's universal language, for better or for worse.
Let's face it.
It's the language of the internet, it's the language of finance,
Thank you.
Thank you.
错误的输出:
All right, take a moment and think back. | 好的,请花一点时间回想一下。
Remember a time when you were sick. | 回忆一下你最近生病的时候。
Recall feeling just well enough for your day. | 回想你虽然感觉不太好,但还能起床过日子。
The language I'm speaking right now is on its way to global dominance. | 我正在说的这种语言正在成为全球通用语言。
It's the language of international domains. | 它是互联网、金融、和其他领域的语言。
Thank you. | 谢谢你们
正确输出:
All right, take a moment and think back. | 好的,请花一点时间回想一下。
Remember a time when you were sick. | 回忆一下你最近生病的时候。
Recall feeling just well enough for your day. | 回想你虽然感觉不太好,但还能起床过日子。
The language I'm speaking right now is on its way to global dominance. | 我正在说的这种语言正在成为全球通用语言。
It's the language of international domains. | 它是互联网、金融、和其他领域的语言。
开始:
<输入的信息>
"""
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.