网络上沉浸式英语听力素材有限。正好最近调试 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. | 它是互联网、金融、和其他领域的语言。
开始:
<输入的信息>
"""
最后生成 7 个多小时的视频花了 5.7 刀,这还包括了我日常 GPT4 的使用,实际花费估计 5 刀左右。
1
sorcerer 340 天前 via Android
不错啊,我也想试试.
|
2
akaken 340 天前
可以,我去试试,正好在学英语哈。对了,楼主可以试试这个网站降低成本: https://orisound.cn ,这里直连 openAI 所有最新模型,api ,价格低,可以试试诶,我直接用最新的 4 的 128k 写代码的。
|
5
JackCkei 337 天前
@akaken 不过老哥我有个问题,APIkey 调用和直接网页用 gpt4 效果一样吗,我之前看有人说 api 调用的 4 更傻一些,网页版有自己的一些优化设置,求回复
|
8
zgpgzhangpeng 337 天前
感谢分享
|
10
allen9009 335 天前
强
|