ParakeetRebeccaRosario/examples/tacotron2_aishell3/voice_cloning.ipynb

384 lines
1021 KiB
Plaintext
Raw Normal View History

2021-04-25 11:11:24 +08:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import paddle\n",
"from matplotlib import pyplot as plt\n",
"from IPython import display as ipd\n",
"import soundfile as sf\n",
"import librosa.display\n",
"from parakeet.utils import display\n",
2021-05-07 14:51:49 +08:00
"paddle.set_device(\"gpu:0\")\n",
2021-04-25 11:11:24 +08:00
"import sys\n",
2021-05-07 14:51:49 +08:00
"sys.path.append(\"../../\")"
2021-04-25 11:11:24 +08:00
]
},
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 2,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 加载模型"
]
},
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 3,
2021-04-25 11:11:24 +08:00
"metadata": {},
2021-05-07 14:51:49 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"vocab_phones:\n",
" Vocab(size: 68,\n",
"stoi:\n",
"OrderedDict([('<pad>', 0), ('<unk>', 1), ('<s>', 2), ('</s>', 3), ('$', 4), ('%', 5), ('&r', 6), ('a', 7), ('ai', 8), ('an', 9), ('ang', 10), ('ao', 11), ('b', 12), ('c', 13), ('ch', 14), ('d', 15), ('e', 16), ('ea', 17), ('ei', 18), ('en', 19), ('eng', 20), ('er', 21), ('f', 22), ('g', 23), ('h', 24), ('i', 25), ('ia', 26), ('iai', 27), ('ian', 28), ('iang', 29), ('iao', 30), ('ie', 31), ('ien', 32), ('ieng', 33), ('ii', 34), ('iii', 35), ('io', 36), ('iou', 37), ('j', 38), ('k', 39), ('l', 40), ('m', 41), ('n', 42), ('o', 43), ('ou', 44), ('p', 45), ('q', 46), ('r', 47), ('s', 48), ('sh', 49), ('t', 50), ('u', 51), ('ua', 52), ('uai', 53), ('uan', 54), ('uang', 55), ('uei', 56), ('uen', 57), ('ueng', 58), ('uo', 59), ('v', 60), ('van', 61), ('ve', 62), ('ven', 63), ('veng', 64), ('x', 65), ('z', 66), ('zh', 67)]))\n",
"vocab+tones:\n",
" Vocab(size: 10,\n",
"stoi:\n",
"OrderedDict([('<pad>', 0), ('<unk>', 1), ('<s>', 2), ('</s>', 3), ('0', 4), ('1', 5), ('2', 6), ('3', 7), ('4', 8), ('5', 9)]))\n"
]
}
],
2021-04-25 11:11:24 +08:00
"source": [
"from examples.ge2e.audio_processor import SpeakerVerificationPreprocessor\n",
"from parakeet.models.lstm_speaker_encoder import LSTMSpeakerEncoder\n",
"\n",
"# speaker encoder\n",
"p = SpeakerVerificationPreprocessor(\n",
" sampling_rate=16000, \n",
" audio_norm_target_dBFS=-30, \n",
" vad_window_length=30, \n",
" vad_moving_average_width=8, \n",
" vad_max_silence_length=6, \n",
" mel_window_length=25, \n",
" mel_window_step=10, \n",
" n_mels=40, \n",
" partial_n_frames=160, \n",
" min_pad_coverage=0.75, \n",
" partial_overlap_ratio=0.5)\n",
2021-04-25 11:11:24 +08:00
"speaker_encoder = LSTMSpeakerEncoder(n_mels=40, num_layers=3, hidden_size=256, output_size=256)\n",
2021-05-07 14:51:49 +08:00
"speaker_encoder_params_path = \"../../pretrained/ge2e/ge2e_ckpt_0.3/step-3000000.pdparams\"\n",
2021-04-25 11:11:24 +08:00
"speaker_encoder.set_state_dict(paddle.load(speaker_encoder_params_path))\n",
"speaker_encoder.eval()\n",
"\n",
"# synthesizer\n",
"from parakeet.models.tacotron2 import Tacotron2\n",
"from examples.tacotron2_aishell3.chinese_g2p import convert_sentence\n",
"from examples.tacotron2_aishell3.aishell3 import voc_phones, voc_tones\n",
"\n",
"synthesizer = Tacotron2(\n",
2021-05-07 14:51:49 +08:00
" vocab_size=68,\n",
2021-04-25 11:11:24 +08:00
" n_tones=10,\n",
" d_mels= 80,\n",
" d_encoder= 512,\n",
" encoder_conv_layers = 3,\n",
" encoder_kernel_size= 5,\n",
" d_prenet= 256,\n",
" d_attention_rnn= 1024,\n",
" d_decoder_rnn = 1024,\n",
" attention_filters = 32,\n",
" attention_kernel_size = 31,\n",
" d_attention= 128,\n",
" d_postnet = 512,\n",
" postnet_kernel_size = 5,\n",
" postnet_conv_layers = 5,\n",
" reduction_factor = 1,\n",
" p_encoder_dropout = 0.5,\n",
" p_prenet_dropout= 0.5,\n",
" p_attention_dropout= 0.1,\n",
" p_decoder_dropout= 0.1,\n",
" p_postnet_dropout= 0.5,\n",
" d_global_condition=256,\n",
" use_stop_token=False,\n",
2021-04-25 11:11:24 +08:00
")\n",
2021-05-07 14:51:49 +08:00
"params_path = \"../../pretrained/tacotron2_aishell3/tacotron2_aishell3_ckpt_0.3/step-450000.pdparams\"\n",
2021-04-25 11:11:24 +08:00
"synthesizer.set_state_dict(paddle.load(params_path))\n",
"synthesizer.eval()\n",
"\n",
"# vocoder\n",
"from parakeet.models import ConditionalWaveFlow\n",
"vocoder = ConditionalWaveFlow(upsample_factors=[16, 16], n_flows=8, n_layers=8, n_group=16, channels=128, n_mels=80, kernel_size=[3, 3])\n",
2021-05-07 14:51:49 +08:00
"params_path = \"../../pretrained/waveflow/waveflow_ljspeech_ckpt_0.3/step-2000000.pdparams\"\n",
2021-04-25 11:11:24 +08:00
"vocoder.set_state_dict(paddle.load(params_path))\n",
"vocoder.eval()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 生成 speaker encoding"
]
},
2021-05-07 14:51:49 +08:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"首先在当前文件夹下新建文件夹 `ref_audio`,把要作为参考的音频存在在这个文件夹中。格式要求是 wav 格式,采样率会被重采样至 16kHz."
]
},
2021-04-25 11:11:24 +08:00
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 4,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
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[
"<IPython.lib.display.Audio object>"
]
},
2021-05-07 14:51:49 +08:00
"execution_count": 4,
2021-04-25 11:11:24 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ref_name = \"女声2.wav\"\n",
"ref_audio_path = f\"./ref_audio/{ref_name}\"\n",
"ipd.Audio(ref_audio_path, normalize=True)"
]
},
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 5,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mel_sequences: (2, 160, 40)\n",
"embed shape: [256]\n"
]
}
],
"source": [
"mel_sequences = p.extract_mel_partials(p.preprocess_wav(ref_audio_path))\n",
"print(\"mel_sequences: \", mel_sequences.shape)\n",
"with paddle.no_grad():\n",
" embed = speaker_encoder.embed_utterance(paddle.to_tensor(mel_sequences))\n",
"print(\"embed shape: \", embed.shape)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 合成频谱"
]
},
2021-05-07 14:51:49 +08:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"因为 AISHELL-3 数据集中使用 `%` 和 `$` 表示韵律词和韵律短语的边界,它们大约对应着较短和较长的停顿,在文本中可以使用 `%` 和 `$` 来调节韵律。\n",
"\n",
"值得的注意的是,句子的有效字符集仅包含汉字和 `%`, `$`, 因此输入的句子只能包含这些字符。"
]
},
2021-04-25 11:11:24 +08:00
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 6,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2021-05-07 14:51:49 +08:00
"['m', 'ei', 'd', 'ang', 'n', 'i', 'j', 've', 'd', 'e', '%', 'x', 'iang', 'iao', 'p', 'i', 'p', 'ieng', 'sh', 'en', 'm', 'e', 'r', 'en', 'd', 'e', 'sh', 'iii', 'h', 'ou', '$', 'n', 'i', 'q', 'ie', 'iao', 'j', 'i', 'zh', 'e', '%', 'zh', 'e', 'g', 'e', 'sh', 'iii', 'j', 'ie', 'sh', 'ang', 'd', 'e', 'r', 'en', '%', 'b', 'ieng', 'f', 'ei', 'd', 'ou', 'j', 'v', 'b', 'ei', 'n', 'i', 'b', 'ieng', 'iou', 'd', 'e', 't', 'iao', 'j', 'ian', '$']\n",
"['0', '3', '0', '1', '0', '3', '0', '2', '0', '5', '0', '0', '3', '4', '0', '1', '0', '2', '0', '2', '0', '5', '0', '2', '0', '5', '0', '2', '0', '4', '0', '0', '3', '0', '4', '4', '0', '4', '0', '5', '0', '0', '4', '0', '4', '0', '4', '0', '4', '0', '4', '0', '5', '0', '2', '0', '0', '4', '0', '1', '0', '1', '0', '4', '0', '4', '0', '3', '0', '3', '3', '0', '5', '0', '2', '0', '4', '0']\n"
2021-04-25 11:11:24 +08:00
]
}
],
"source": [
2021-05-07 14:51:49 +08:00
"sentence = \"每当你觉得%想要批评什么人的时候$你切要记着%这个世界上的人%并非都具备你禀有的条件$\"\n",
2021-04-25 11:11:24 +08:00
"phones, tones = convert_sentence(sentence)\n",
"print(phones)\n",
"print(tones)\n",
"\n",
"phones = np.array([voc_phones.lookup(item) for item in phones], dtype=np.int64)\n",
"tones = np.array([voc_tones.lookup(item) for item in tones], dtype=np.int64)\n",
"\n",
"phones = paddle.to_tensor(phones).unsqueeze(0)\n",
"tones = paddle.to_tensor(tones).unsqueeze(0)\n",
"utterance_embeds = paddle.unsqueeze(embed, 0)"
]
},
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 7,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2021-05-07 14:51:49 +08:00
" 74%|███████▍ | 741/1000 [00:02<00:01, 249.49it/s]\n"
2021-04-25 11:11:24 +08:00
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"content exhausted!\n"
]
},
{
"data": {
2021-05-07 14:51:49 +08:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEYC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SqSbqxtIiIkddpkSoerzQEYrfFuF5vVmArJfwe5sWPYeuR0to4rcOXsr7NPoZVT5xzJz99yND9bOmXb8VFsg2gEQbQVt1+oXKLr8T22M3blEilLgaUR8UC6fQtJYnlJ0mSA9GuXIwHMzHZ17cN/++lhe03ULJFExEpgiaQD0l2nAwtIRghclO67CLi1VjGYmQ19/VtrqxZqPWrrw8CN6YitRcB7SZLXzZIuBhYD76xxDGbWDRUKbHrbUUy85AX+ZdpcXi43c82K03j+1d35/DFnU1q9mr0K8ykW25ITOg7giXDp9xqrovTJoKppIomIR4HOZlieXsv7mpkNFxFQ8qt2zcysL3blUVtmZtZH7TPbs8yJxGxXIoFy5JoaIYKtpxzCn2fmOejwxbz87/vy8ftmEq2tlFvXMz7WUgKIINpaBzvyXdou/YzEzMz6Zieq/w44JxIzsywLUSz3T62tWnEiMRvO0q4soozyeVCO/KQ92HToZBa/VeTHtNHwdB1tb1xFY6ykFLG96GKhzl1aGdD+hsQscyIxM8s4d22ZmdlO8zMSMxtYuTy5xgbU1IhGjWTj6ybx53eU+MLxt3L2iMWUgYdbxjNn+Sm8dM8Mpt3YSuGZZyjn8+nk9DKUk1nqUfZs9axwIjEzs53meSRmZtZnfthuZjWjhoZkciFAPo8aG6GuwPojJrP8DaLcUGbCb+u5afap3Pj8ixDldBTXavZiNcC2SYeWUeGuLTMz6wM/bDczsz5zIjGzfqeGBnKjR6OGetr23p3NkxoovO8
2021-04-25 11:11:24 +08:00
"text/plain": [
2021-05-07 14:51:49 +08:00
"<Figure size 432x288 with 2 Axes>"
2021-04-25 11:11:24 +08:00
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"outputs = synthesizer.infer(phones, tones=tones, global_condition=utterance_embeds)\n",
"mel_input = paddle.transpose(outputs[\"mel_outputs_postnet\"], [0, 2, 1])\n",
2021-05-07 14:51:49 +08:00
"fig = display.plot_alignment(outputs[\"alignments\"][0].numpy().T)"
2021-04-25 11:11:24 +08:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 合成语音"
]
},
2021-05-07 14:51:49 +08:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"合成的语音会保存在 `syn_audio` 目录下,使用和 reference 相同的文件名。"
]
},
2021-04-25 11:11:24 +08:00
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 8,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2021-05-07 14:51:49 +08:00
"time: 23.468628406524658s\n"
2021-04-25 11:11:24 +08:00
]
},
{
"data": {
"text/plain": [
2021-05-07 14:51:49 +08:00
"<matplotlib.collections.PolyCollection at 0x7fcd141cc650>"
2021-04-25 11:11:24 +08:00
]
},
2021-05-07 14:51:49 +08:00
"execution_count": 8,
2021-04-25 11:11:24 +08:00
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2021-05-07 14:51:49 +08:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO2dd5gV5fXHv2cLVTqINFmaUiyIK2KLCqgQjBhjj8ZuTCwxJkYMtlgSNPlZYtSoWLBhFKMSRRFREUWUBQGpirg0KSsdqbt7fn/cmWV2dvq8U+695/M8++y9M3Nn3t078573Pe8530PMDEEQBCF/KUi6AYIgCEKyiCEQBEHIc8QQCIIg5DliCARBEPIcMQSCIAh5TlHSDQhC69atuaSkJOlmCIIgZBUzZ878gZnbmLdnpSEoKSlBWVlZ0s0QBEHIKohomdV2cQ0JgiDkOWIIBEEQ8hwxBIIgCHmOGAJBEIQ8R4khIKKniWgdEc2z2U9E9E8iWkJEc4mon2HfRUT0jfZzkYr2CIIgCN5RNSN4FsAQh/1DA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RRlWcT7chRYQg6ADCGxKzUtpn5BRHNJaJxRNTJ52dBRFcSURkRlVVU2Psn57hI0d765nzH/U6s3VI7fn3Lzj01N+v7C+JNUlLJox8twY828tf6opxTMZ2oSTq6J8gsJ4yulVUn9/E3P+CIe94PfE7Am9vEbV3tXEMZ1aU2hm3mso1KSn46tcVuz9If0hMJlk3EtVj8PwAlzHwIMqP+MX5PwMxPMHMpM5e2adPG/rjgbXTFHFHA1Xv
2021-04-25 11:11:24 +08:00
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"with paddle.no_grad():\n",
" wav = vocoder.infer(mel_input)\n",
"wav = wav.numpy()[0]\n",
"sf.write(f\"syn_audio/{ref_name}\", wav, samplerate=22050)\n",
"librosa.display.waveplot(wav)"
]
},
{
"cell_type": "code",
2021-05-07 14:51:49 +08:00
"execution_count": 10,
2021-04-25 11:11:24 +08:00
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <audio controls=\"controls\" >\n",
2021-05-07 14:51:49 +08:00
" <source src=\"data:audio/wav;base64,UklGRgTKBQBXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YeDJBQAMABIAEQARABUAEQAOAAoABgAEAAcABQAIABAAEQAaABQAFgATABAAEAALABAAFAAbABYAGAAYABgAGgAZABwAGgAcABIAEwAVABMAFAAZABcAGQAaABcAGgAZABYAFQAXABcAFwAXABoAFwAUABMAFgAcABkAFwAZABYAHQAXABsAHwAeABwAGQAZABYAHAAeABkAFAAVABMAEAATABUAFQAaABgAFgAUAA0AEwAUAA8AEQAPAAsABwAIAA8ACwAQABIAEQARABQAEQAMAA8AFAAQABAADgALAAoABgALAAoACwAFAAMAAgABAAsA/P/+/wEA/f/+//r/9v/3//H/8f/3//X/8v/t//X/9v/w/+v/7f/s/+z/7f/v//H/8f/6//z//f/5/wQACAAHAAkABgADAAIAAgD+/wAAAAAAAAEA/f/9/wAA+/8AAAAAAQAAAAAABwAEAAMABAD//wAABAADAAAAAQD7//7//v/1//P/+f/4//j/+//1//X/5//u/+r/6v/q/+f/7P/m/+j/6//p/+j/5f/j/+j/5f/n//D/8f/x//D/7P/w/+//9P/z//n//P/3//r/9f/5//T/+f/4//n/AQABAAIAAgD+/wIAAwAAAAMAAAD///z//////wAACAAIAAUABwAHAAIAAwAKAAkACgABAAYACQAIAA0ABwAKAAYABQAGAAQABQAFAAIABgAFAAIABgAEAAkAEAALAA0ADAAOAAUACAAPAAwACQAJAAoACAAKAAcADgAHAAcACAABAAkACgAFAAoABwAAAAAA/v/7//3//P///wIABgACAAAA/v//////+f8AAAEAAQAAAP3/AAAAAPv//f8AAPz/+//6//P/8v/4//b/+f8BAP7/AgD9//b//P/y//P/6//r//H/8P/w/+//7P/w//X/9v/2//v////1//T/+f8AAP7/+//5//n/+//9/wEAAAAFAAEAAgD+/wAAAQD4/wIA///9//z/+f/7//r//v/7//H/8//v//H/8//t//r/9//6//f/7f/0/+7/7f/u//D/8P/z//P/8v/5//7/+/8AAPr/+f/3//H/9//v//P/9/8AAAAA/P8AAPv/AAD9/wYACAAFAA4ACQAIAAgAAAD+/woAEAAOABMAHQAgACEAGgAeACQAIAApACYALgAwAC0AOwAwADQAOwA3AD0AOQA8ADkAPwA/ADwAPwA7ADwAOgA+ADsAQABCAEIANQAsACkAJgAjACoAMAAmAC0AKwApACkAKAAlACcAJgAfABYAEgAVABEADwALAAwACwAIAAAAAgD///7//v/1//H/7P/v/+n/6//w//H/7f/o//P/9f/3//3//v/8//z/9f/0//X/9f/+//7//f/+/wIABwAEAAIACgAGAP7//f/6//r//f/+//3/+v///wAA///6//z/AgADAAgACAADAP//AQAJABIAFwAWABQAEAATABQAFwAWABoAHwAbAB0AGwASABMAFAALAA0AAAADAAMAAAACAAQAAgAFAAkACAAGAAcACwD9/wEA+//8//3/+P/2//b/9//z//X/9v/z/+//8f/w//P/+f/4//j/8P/v//T/8f/6//b/+P/7//j//v/7//v/AAAJAAQAAgAFAAAA/f/7//7/+/8DAAAAAQAIAAAAAgD4//P/+P/z//f/9//y//f/+P/6//n/+//5//b/9P/u//r/+f/u/+7/7//2//X/9//1/+//+f/5//7/AAABAAcAAAD5//r/AQAEAAUAAwD//wAABAABAPn/+f8DAP////8DAPv/AgADAAAAAAAAAPn/+f/4/+//6f/t//P/8f/5//7//P/5//z/9//q/+X/4v/j/+f/4f/l//D/+P/+//z/AAD+//z/+f/8//X/9f/2//X/9v/t/+j/5f/u//T/8P/w/+r/6P/l/9r/3P/g/+j/3v/e/9r/1P/Y/9L/1P/P/9P/zf/R/9n/1//W/9P/0v/R/9L/zv/K/8X/zP/O/9H/2P/X/9X/yf/O/8X/xf/U/9b/3f/m/+T/3v/n/+n/8f/x//X//f/5////AwABAAMAAAAKABQAFAAcACEAIQAlAB8AIQAtADcAQABHAEQAPAA7ADEALAAnADIAPwA8AD4AOQBEAE0ARgBHAEYAQgBKAEgAQAA2AC0AKQAuADMAKgApADYANQA2AD8AQgBGADkAMgAwACcAJwAwACoAJAAoACIAJQAfABUAFwAVABIADQARABsAHgAdABMAFgAWAAgAEAAQABMAGgAZABUABgABAAUABQADAAcA+//5//X/5//q/+f/5//s/+z/5v/i/9z/5v/u/+v/4v/S/8//zv/E/7v/vv/S/9r/2//U/9f/1//N/97/3P/V/9T/zf/K/9T/1//d/+T/2//i/9r/3//q/+D/6f/2//D/8//8//n/+v/5/+7/9/8DAPv//P/3//H/8P/p//D/9f/5//z//v/2/+z/6//s//T/8/////v/9v/5//D/8//0//D/CAAVAAkADgAIAAEAAQAEAPn/AAAHAAYACQAEAAYAAAAAAAIADgALABEAIAApACkAGwATABgAIAAjAB4ADgAAAAMACQAOABMAFAAaABUAEAAWABkAHwArADIAJgAgACIAFAATABQAGAATAA4ADwANABAADgARAAYADQAXAP3/9v/8//b/9f/l/+X/2//e/+r/4//i/9n/w/+5/8L/uf+2/7j/vP/A/7z/xf/D/7D/wP/Q/8D/vP+4/7P/tv+u/67/uf/C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QCdkKvAspDQcOBA/RDxERPhKhEm8TfxOrE8MT9RI4EkMQQg7UDGkLmwpoCZkIvAeRBi8FgwM+AuAANAA6/wb+Av2r+876b/oA+vb59/nP+cP59/ho+O73Z/cz9/b
2021-04-25 11:11:24 +08:00
" Your browser does not support the audio element.\n",
" </audio>\n",
" "
],
"text/plain": [
"<IPython.lib.display.Audio object>"
]
},
2021-05-07 14:51:49 +08:00
"execution_count": 10,
2021-04-25 11:11:24 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ipd.Audio(wav, rate=22050)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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",
2021-05-07 14:51:49 +08:00
"version": "3.7.7"
2021-04-25 11:11:24 +08:00
}
},
"nbformat": 4,
"nbformat_minor": 4
}