sounds-of-american-english draft

This commit is contained in:
xiaolai
2024-03-05 10:35:23 +08:00
parent a8ffc4e4ab
commit decfe71c7d
213 changed files with 306 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -281,7 +281,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.1"
}
},
"nbformat": 4,

Binary file not shown.

Binary file not shown.

View File

@@ -18,12 +18,51 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "77deb08f-fec3-4327-b2f9-1c893aacaddc",
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting edge-tts\n",
" Downloading edge_tts-6.1.10-py3-none-any.whl.metadata (4.3 kB)\n",
"Collecting aiohttp>=3.8.0 (from edge-tts)\n",
" Downloading aiohttp-3.9.3-cp312-cp312-macosx_11_0_arm64.whl.metadata (7.4 kB)\n",
"Requirement already satisfied: certifi>=2023.11.17 in /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages (from edge-tts) (2024.2.2)\n",
"Collecting aiosignal>=1.1.2 (from aiohttp>=3.8.0->edge-tts)\n",
" Downloading aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB)\n",
"Requirement already satisfied: attrs>=17.3.0 in /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages (from aiohttp>=3.8.0->edge-tts) (23.2.0)\n",
"Collecting frozenlist>=1.1.1 (from aiohttp>=3.8.0->edge-tts)\n",
" Downloading frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (12 kB)\n",
"Collecting multidict<7.0,>=4.5 (from aiohttp>=3.8.0->edge-tts)\n",
" Downloading multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl.metadata (4.2 kB)\n",
"Collecting yarl<2.0,>=1.0 (from aiohttp>=3.8.0->edge-tts)\n",
" Downloading yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl.metadata (31 kB)\n",
"Requirement already satisfied: idna>=2.0 in /opt/homebrew/Caskroom/miniconda/base/lib/python3.12/site-packages (from yarl<2.0,>=1.0->aiohttp>=3.8.0->edge-tts) (3.4)\n",
"Downloading edge_tts-6.1.10-py3-none-any.whl (27 kB)\n",
"Downloading aiohttp-3.9.3-cp312-cp312-macosx_11_0_arm64.whl (389 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m389.7/389.7 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hUsing cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)\n",
"Downloading frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl (51 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m51.9/51.9 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl (29 kB)\n",
"Downloading yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl (79 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m79.4/79.4 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hInstalling collected packages: multidict, frozenlist, yarl, aiosignal, aiohttp, edge-tts\n",
"Successfully installed aiohttp-3.9.3 aiosignal-1.3.1 edge-tts-6.1.10 frozenlist-1.4.1 multidict-6.0.5 yarl-1.9.4\n",
"Collecting pygame\n",
" Downloading pygame-2.5.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (13 kB)\n",
"Downloading pygame-2.5.2-cp312-cp312-macosx_11_0_arm64.whl (12.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0mm\n",
"\u001b[?25hInstalling collected packages: pygame\n",
"Successfully installed pygame-2.5.2\n"
]
}
],
"source": [
"!pip install edge-tts\n",
"!pip install pygame"
@@ -214,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.1"
}
},
"nbformat": 4,

View File

@@ -190,7 +190,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.1"
}
},
"nbformat": 4,

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,221 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "b94f103d-ac43-4d13-83cb-eb5090220881",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"source": [
"# EdgeTTS\n",
"\n",
"https://github.com/rany2/edge-tts\n",
"\n",
"edge-tts is a Python module that allows you to use Microsoft Edge's online text-to-speech service from within your Python code or using the provided edge-tts or edge-playback command."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "77deb08f-fec3-4327-b2f9-1c893aacaddc",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"!pip install edge-tts\n",
"!pip install pygame"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "9aad6634-e833-4ec4-b285-84e051329712",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Files created!\n"
]
}
],
"source": [
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"\"\"\n",
"Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,Golf,Hotel,India,Juliet,Kilo,Lima,Mike,November,Oscar,Papa,Quebec,Romeo,Sierra,Tango,Uniform,Victor,Whiskey,X-ray,Yankee,Zulu\n",
"\"\"\"\n",
"\n",
"Wordlist = TEXT.split(\",\")\n",
"\n",
"for w in Wordlist:\n",
" for VOICE in ['en-US-GuyNeural', 'en-US-JennyNeural']:\n",
" w = w.strip()\n",
" OUTPUT_FILE = f\"{w.replace(' ', '-').replace('?', '')}-{VOICE.replace('en-', '').replace('GuyNeural', 'guy').replace('JennyNeural', 'jen').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,
"id": "1e54069c-db63-45ba-86e8-726730b19255",
"metadata": {},
"outputs": [],
"source": [
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"Jane,dramatic,young,girl,loves,to,read,books,at,leisure,in,rooms,or,play,on,a,sunny,day,outdoor,here,and,there,under,the,trees,with,boys,She,vowed,to,buy,a,red,ear,dog,She,thought,it,was,unique,for,sure,Now,she,feeds,it,dough,nuts,and,cheese,bar\"\n",
"Wordlist = TEXT.split(\",\")\n",
"\n",
"for w in Wordlist:\n",
" for VOICE in ['zh-CN-YunxiNeural', 'zh-CN-XiaoxiaoNeural']:\n",
" w = w.strip()\n",
" OUTPUT_FILE = f\"{w}-{VOICE.replace('YunxiNeural', 'male').replace('XiaoxiaoNeural', 'female').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,
"id": "09d5ab47-5807-4ded-a8b9-45277831d425",
"metadata": {},
"outputs": [],
"source": [
"# VOICE = \"en-US-GuyNeural\" # Male\n",
"# VOICE = \"en-US-AnaNeural\" # Female\n",
"# VOICE = \"en-US-AndrewNeural\" # Male\n",
"# VOICE = \"en-US-AriaNeural\" # Female\n",
"# VOICE = \"en-US-AvaNeural\" # Female\n",
"# VOICE = \"en-US-BrianNeural\" # Male\n",
"# VOICE = \"en-US-ChristopherNeural\" # Male\n",
"# VOICE = \"en-US-EmmaNeural\" # Female\n",
"# VOICE = \"en-US-EricNeural\" # Male\n",
"# VOICE = \"en-US-GuyNeural\" # Male\n",
"# VOICE = \"en-US-JennyNeural\" # Female\n",
"# VOICE = \"en-US-MichelleNeural\" # Female\n",
"# VOICE = \"en-US-RogerNeural\" # Male\n",
"# VOICE = \"en-US-SteffanNeural\" # Male\n",
"# VOICE = \"en-GB-LibbyNeural\" # Female\n",
"# VOICE = \"en-GB-MaisieNeural\" # Female\n",
"# VOICE = \"en-GB-RyanNeural\" # Male\n",
"# VOICE = \"en-GB-SoniaNeural\" # Female\n",
"# VOICE = \"en-GB-ThomasNeural\" # Male\n",
"# VOICE = \"en-AU-NatashaNeural\" # Female\n",
"# VOICE = \"en-AU-WilliamNeural\" # Male\n",
"# VOICE = \"en-CA-ClaraNeural\" # Female\n",
"# VOICE = \"en-CA-LiamNeural\" # Male\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "862f0948",
"metadata": {},
"outputs": [],
"source": [
"pygame.mixer.init()\n",
"pygame.mixer.music.load(OUTPUT_FILE)\n",
"pygame.mixer.music.play()"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "00939422-fbf9-4842-b82a-b6106624c075",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pygame 2.5.2 (SDL 2.28.3, Python 3.11.5)\n",
"Hello from the pygame community. https://www.pygame.org/contribute.html\n",
"Files created!\n"
]
}
],
"source": [
"import asyncio\n",
"import edge_tts\n",
"import pygame\n",
"\n",
"TEXT = \"a,and,at,bar,books,boys,buy,cheese,day,dog,dough,dramatic,ear,feeds,for,girl,here,in,it,Jane,leisure,loves,Now,nuts,on,or,outdoor,play,read,red,rooms,She,sunny,sure,the,there,thought,to,trees,under,unique,vowed,was,with,young\"\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",
" w = w.strip()\n",
" OUTPUT_FILE = f\"{w}-{VOICE.replace('GuyNeural', 'Guy-Male').replace('JennyNeural', 'Jenny-Female').replace('RyanNeural', 'Ryan-Male').replace('SoniaNeural', 'Sonia-Female').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,
"id": "93f68a91-7e6b-45ef-932e-533b695e4ac1",
"metadata": {},
"outputs": [],
"source": [
"# ru-RU-DmitryNeural\n",
"# ko-KR-InJoonNeural"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "474c3f39-11ed-4d0a-b039-63df8b270044",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"print(os.getcwd())"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2128587f-e6c8-488d-8c40-6c958b9c735e",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More