keep updated

This commit is contained in:
xiaolai
2024-03-26 07:48:22 +08:00
parent 89ef46954a
commit d3a32e6a68
41 changed files with 232 additions and 128 deletions

View File

@@ -161,7 +161,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 53,
"id": "00939422-fbf9-4842-b82a-b6106624c075",
"metadata": {},
"outputs": [
@@ -174,11 +174,13 @@
}
],
"source": [
"#American\n",
"\n",
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"ah-oh\"\n",
"TEXT = \"sink, think, zed, that\"\n",
"Wordlist = TEXT.split(\",\")\n",
"\n",
"for w in Wordlist:\n",
@@ -206,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 51,
"id": "474c3f39-11ed-4d0a-b039-63df8b270044",
"metadata": {},
"outputs": [
@@ -219,11 +221,13 @@
}
],
"source": [
"# British\n",
"\n",
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"take,water,fitness,witness,winter\"\n",
"TEXT = \"speak, student, school, frustrate\"\n",
"Wordlist = TEXT.split(\",\")\n",
"\n",
"for w in Wordlist:\n",
@@ -238,6 +242,78 @@
"print(\"Files created!\") "
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "42ecfe3f-f3ac-4fb7-92d0-795d51972051",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files created!\n"
]
}
],
"source": [
"#Korean\n",
"\n",
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"photo, video\"\n",
"Wordlist = TEXT.split(\",\")\n",
"\n",
"for w in Wordlist:\n",
" # for VOICE in ['en-US-GuyNeural', 'en-US-JennyNeural', 'en-GB-RyanNeural', 'en-GB-SoniaNeural']:\n",
" for VOICE in ['ko-KR-InJoonNeural']:\n",
" w = w.strip()\n",
" # OUTPUT_FILE = f\"{w}-{VOICE.replace('EricNeural', 'Guy-Male').replace('JennyNeural', 'Jenny-Female').replace('RyanNeural', 'Ryan-Male').replace('SoniaNeural', 'Sonia-Female').lower()}.mp3\"\n",
" OUTPUT_FILE = f\"{w}-{VOICE.replace('InJoonNeural', 'kr').replace('SoniaNeural', 'Female').replace('ko-KR', 'ko').lower()}.mp3\"\n",
" communicate = edge_tts.Communicate(w, VOICE)\n",
" await communicate.save(OUTPUT_FILE) \n",
"\n",
"print(\"Files created!\") "
]
},
{
"cell_type": "code",
"execution_count": 50,
"id": "95b12e63-f92d-49b4-bd51-a2b9d059fd52",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files created!\n"
]
}
],
"source": [
"#Chinese\n",
"\n",
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"very\"\n",
"Wordlist = TEXT.split(\",\")\n",
"\n",
"for w in Wordlist:\n",
" # for VOICE in ['en-US-GuyNeural', 'en-US-JennyNeural', 'en-GB-RyanNeural', 'en-GB-SoniaNeural']:\n",
" for VOICE in ['zh-CN-liaoning-XiaobeiNeural']:\n",
" w = w.strip()\n",
" # OUTPUT_FILE = f\"{w}-{VOICE.replace('EricNeural', 'Guy-Male').replace('JennyNeural', 'Jenny-Female').replace('RyanNeural', 'Ryan-Male').replace('SoniaNeural', 'Sonia-Female').lower()}.mp3\"\n",
" OUTPUT_FILE = f\"{w}-{VOICE.replace('liaoning-XiaobeiNeural', 'zh').replace('SoniaNeural', 'Female').replace('zh-CN', 'cn').lower()}.mp3\"\n",
" communicate = edge_tts.Communicate(w, VOICE)\n",
" await communicate.save(OUTPUT_FILE) \n",
"\n",
"print(\"Files created!\") "
]
},
{
"cell_type": "code",
"execution_count": null,