Parakeet/examples/tacotron2_aishell3/voice_cloning.ipynb

384 lines
1013 KiB
Plaintext
Raw Normal View History

add ge2e and tacotron2_aishell3 example (#107) * hacky thing, add tone support for acoustic model * fix experiments for waveflow and wavenet, only write visual log in rank-0 * use emb add in tacotron2 * 1. remove space from numericalized representation; 2. fix decoder paddign mask's unsqueeze dim. * remove bn in postnet * refactoring code * add an option to normalize volume when loading audio. * add an embedding layer. * 1. change the default min value of LogMagnitude to 1e-5; 2. remove stop logit prediction from tacotron2 model. * WIP: baker * add ge2e * fix lstm speaker encoder * fix lstm speaker encoder * fix speaker encoder and add support for 2 more datasets * simplify visualization code * add a simple strategy to support multispeaker for tacotron. * add vctk example for refactored tacotron * fix indentation * fix class name * fix visualizer * fix root path * fix root path * fix root path * fix typos * fix bugs * fix text log extention name * add example for baker and aishell3 * update experiment and display * format code for tacotron_vctk, add plot_waveform to display * add new trainer * minor fix * add global condition support for tacotron2 * add gst layer * add 2 frontend * fix fmax for example/waveflow * update collate function, data loader not does not convert nested list into numpy array. * WIP: add hifigan * WIP:update hifigan * change stft to use conv1d * add audio datasets * change batch_text_id, batch_spec, batch_wav to include valid lengths in the returned value * change wavenet to use on-the-fly prepeocessing * fix typos * resolve conflict * remove imports that are removed * remove files not included in this release * remove imports to deleted modules * move tacotron2_msp * clean code * fix argument order * fix argument name * clean code for data processing * WIP: add README * add more details to thr README, fix some preprocess scripts * add voice cloning notebook * add an optional to alter the loss and model structure of tacotron2, add an alternative config * add plot_multiple_attentions and update visualization code in transformer_tts * format code * remove tacotron2_msp * update tacotron2 from_pretrained, update setup.py * update tacotron2 * update tacotron_aishell3's README * add images for exampels/tacotron2_aishell3's README * update README for examples/ge2e * add STFT back * add extra_config keys into the default config of tacotron * fix typos and docs * update README and doc * update docstrings for tacotron * update doc * update README * add links to downlaod pretrained models * refine READMEs and clean code * add praatio into requirements for running the experiments * format code with pre-commit * simplify text processing code and update notebook
2021-05-13 17:49:50 +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",
"paddle.set_device(\"gpu:0\")\n",
"import sys\n",
"sys.path.append(\"../../\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 加载模型"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"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"
]
}
],
"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",
"speaker_encoder = LSTMSpeakerEncoder(n_mels=40, num_layers=3, hidden_size=256, output_size=256)\n",
"speaker_encoder_params_path = \"../../pretrained/ge2e/ge2e_ckpt_0.3/step-3000000.pdparams\"\n",
"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",
" vocab_size=68,\n",
" 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",
")\n",
"params_path = \"../../pretrained/tacotron2_aishell3/tacotron2_aishell3_ckpt_0.3/step-450000.pdparams\"\n",
"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",
"params_path = \"../../pretrained/waveflow/waveflow_ljspeech_ckpt_0.3/step-2000000.pdparams\"\n",
"vocoder.set_state_dict(paddle.load(params_path))\n",
"vocoder.eval()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 生成 speaker encoding"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"首先在当前文件夹下新建文件夹 `ref_audio`,把要作为参考的音频存在在这个文件夹中。格式要求是 wav 格式,采样率会被重采样至 16kHz."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <audio controls=\"controls\" >\n",
" <source src=\"data:audio/x-wav;base64,UklGRmaYBQBXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAATElTVDoAAABJTkZPSU5BTRcAAADnmb7luqbnp5HmioDlm60y5Y+35qW8AABJU0ZUDgAAAExhdmY1OC40NS4xMDAAZGF0YQCYBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
" Your browser does not support the audio element.\n",
" </audio>\n",
" "
],
"text/plain": [
"<IPython.lib.display.Audio object>"
]
},
"execution_count": 4,
"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",
"execution_count": 5,
"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": [
"## 合成频谱"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"因为 AISHELL-3 数据集中使用 `%` 和 `$` 表示韵律词和韵律短语的边界,它们大约对应着较短和较长的停顿,在文本中可以使用 `%` 和 `$` 来调节韵律。\n",
"\n",
"值得的注意的是,句子的有效字符集仅包含汉字和 `%`, `$`, 因此输入的句子只能包含这些字符。"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['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"
]
}
],
"source": [
"sentence = \"每当你觉得%想要批评什么人的时候$你切要记着%这个世界上的人%并非都具备你禀有的条件$\"\n",
"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",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" 73%|███████▎ | 733/1000 [00:02<00:01, 255.71it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"content exhausted!\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEYCAYAAAB2qXBEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3deZgdZZn+8e99Tm/pzr6QBAIkSIiAQoAMu4iyowPq8HPAZSIyZhwVdXAB1HHUmXHihrigGAGJjooMikRFAUFUZEvYdwgBTJAkkIXsvZzz/P6o6uSk6eUk3adPdff9ua66uqpOLU+nkzz9vvW+TykiMDMz21m5agdgZmYDmxOJmZn1ihOJmZn1ihOJmZn1ihOJmZn1Sk21AyhHneqjgaZqh2FmQ5WA9gGuw4eR260VgD3q1lCrHEIE20bAPre0jZdWF9QXtz7pDU2xanWh7OPvebD5hog4uS/uXa4BkUgaaOIwHVftMMxsKMrlUU5EWxsAMXMmDV9cTo0KfHPqtUzON5JXjkIUt55y+MnL+uz2q1YXuPuGPco+Pj/5qfF9dvMyDYhEYmY2VAVQpNjjcdXkRGJmVkK1dURrC6qtg5zIjR6FJL585y/Zu7aGuS+1cON/HwMRzLnhVArr10MEaFtP1lPFNX0YUWzX2skiJxIzswxLWiTZrkDiRGJmlmFB0BrlP2yvBicSMxu6SrqjcsOHs/SDr+WYf7iXr06+m1YKFCN4ri1PCzk+cdjpFFasBInhWghRpFBaq7CCdQvdIjEzs50WQMGJxMzMesMtEjOzaku7sHLDhxNbmlFDPRSLsPce6K/LufbhG1lRaOb1N83gifP35623tkIUO3RXrYRcPlkt9t8zi4Dtu9AyyInEzCzjsj3414nEzCzTgvAzEjOz/qb6elRTk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o2SR8CbgDywBUR8YikLwCLImIB8DHg+5L+jaRn7T0R3f8gK5ZIJI0CjgHek34DLUCLpNOBY9PD5gO34kRiZtalvizaGBHXkwzpLd332ZL1R4GjduSalWyRTCNpDv1A0oHAPcBHgIkR8UJ6zHJgYmcnS5oDzAFooLGCYZqZZVfStZXtmRqVTCQ1wMHAuRFxl6RvkHRjbRURIanTJlM6XG0ewEiNdfvYrFIkcsOGoalTaJ48gr+eUMdV//gN9q2FE86bxSU3H0lxw0YkEW1t/L7tMBp1N+Tz23ddRRBtbVX7NgazoVwiZRmwLCLuSrevIUksKyRNBki/djkSwMxsqGsf/ttHD9sromKJJCKWA0slzUh3HQc8SjJCYHa6bzZwXaViMDMb+Pq21lYlVHrU1rnAj9MRW0uAs0mS19WSzgGeA95e4RjMrKNcHooFVn7wSC77+MUA3L5pOgvX7cnzN76Gz+x/LMVNmxhRs4hCWxtIhLuxqqaM0idVVdFEEhH3A53NsDyukvc1MxssIqDgV+2amVlvDOVRW2Zm1kvtM9uzzInEbLAreR1ubtQIaGll/fH7csu3vsMBt7+Wzx7x98SWLcSWZorN69mTOyimz0OikL761jPUq2pIPyMxM7Pe2Ynqv/3OicTMLMtCtBX7ptZWpTiRmA02Esrnk24p5VBO5MaNpbjrBJYfPpL8m1axdl0zb54yiz30KG3FtPsql9/aBeaii9nR/obELHMiMTPLOHdtmZnZTvMzEjOrPAnV1JIb3oQah7F5/11ZcUgd+576JN/a85fUSjzcMoLbN07n8geOZMJVY5l+3xoKEWzXY5J2cUV7V5dlhhOJmZntNM8jMTOzXvPDdjPrc/mRI5P3gaQTBtU4jJePnsryw3IUxreQX1XkpbnTOPvGNxJtrclIrGKwNw9CFNnaeeVurOwLd22ZmVkv+GG7mZn1mhOJmfUJ1dSQa2xETY1snLk7dS+3sOK
"text/plain": [
"<Figure size 432x288 with 2 Axes>"
]
},
"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",
"fig = display.plot_alignment(outputs[\"alignments\"][0].numpy().T)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 合成语音"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"合成的语音会保存在 `syn_audio` 目录下,使用和 reference 相同的文件名。"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 19.793312788009644s\n"
]
},
{
"data": {
"text/plain": [
"<matplotlib.collections.PolyCollection at 0x7f09e00f6fd0>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEGCAYAAABmXi5tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO2dd5QVVbbGv90BkJxzaDICAkKLGJCoA7QDKhgY8zx1zOm9x6DOGEcFdUwzijJiHBV9mBiJoiAgQYIgWQGbnBGQTHef90ff6q6urlynUtf+rcXihrpVu++t+uqcfXYgIQQYhmGYsk9a2AYwDMMwwcCCzzAMkxBY8BmGYRICCz7DMExCYMFnGIZJCBlhG2BE7dq1RVZWVthmMAzDxIolS5bsFULU0XsvsoKflZWFxYsXh20GwzBMrCCiTUbvsUuHYRgmIbDgMwzDJAQWfIZhmITAgs8wDJMQWPAZhmESAgs+wzBMQmDBZxiGSQgs+AzDMAmBBT9gVm8/hKFj5iEvvyBsUxiGSRgs+AEzddVOLNn0K976LjdsUxiGSRgs+AGTX1A4sn9y8pqQLWEYJmmw4AfMT7sOh20CwzAJhQU/QIQQOJHHvnuGYcKBBT9AJq3Ygdk/7QnbDIZhEgoLfoBs2X8sb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RoI4RoKYR4MvXaw0KIianHDwghOgghOgsh+gghAg9ut1oQ2qjjN1ZnRSpYjUz0PhMGp/KK7fQSY6/lnfn6U2d1fLvT0dtug1mDTKxKJS/0YTFXXSvHDlt/PWoqqkIIPG3DzeImjv2gwQ1bCThYv/sw2v3VfvnvE3n
"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",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <audio controls=\"controls\" >\n",
" <source src=\"data:audio/wav;base64,UklGRgS6BQBXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YeC5BQAJAAIAAgD///3//v8AAAIA/v/9//v/9v/y/+//9v/4//v/+P/7//7//f8AAPr/+//4//j/8v/v/+//6v/v/+z/6v/v//H/7v/p/+j/5v/s/+n/7P/z//H/8//0//X/9//4//T/8//z//f/8//1//v/+//8//7/AgD8/wAABwAKAAoADgAJAAsADgANAA0ACwARAAsAEAAQAAoAAwAIAAkACQANAAcACAAKAA8ACwAIAAkABwAKAAQABgAKAAsACQAIAAoACQAMAAsADwAPAA8ADQAOABIACwAJAAoACwANAAUAAgAHAAMABAAFAAoABwAFAAQAAAABAAAAAAACAAMAAgAHAAYAAAACAAAA+v/9/////v////r//v/7//r/AAD2//r//P/7//3/+v/5//3//v/4//r/AAD5//T/+f/4//r//P////v/+f/5/wAAAAD7//3/+f/7//z/AAD///z/+v/8//z/+P/9////+f/6//7/+//6//z/9v/6/wEA+v/+//v/+f8AAPv/+v/1//L/7//v//T/8v/z//v/+v/1//v/8//4//b/9//2//X/+f/w//n/8P/u/+7/7P/r/+v/8P/1//P/8f/0//P/9f/z//H/7//x/+//7f/n/+7/7v/x/+z/6//u/+r/7P/l/+b/6//w/+r/8f/o/+3/8P/r//T/8P/5//T/8P/w//f//f/6//z////6//r/BQACAAcA//8AAAAA/P////b/+P/8/wMACQAIAAkAFQAQAA4ACAAJAAkABwANAAUACAAKAAoACgARAA8AEQAOABAAGAAYABoAEgASAAkABQAKAAsAEwANAAwADAAIAAkADAAPAA0ADQANAAsACAALAAMABAAJAAkACwAIAAUACAALAAkABwAEAAgACwAMAAYACwAKAAcACgAKABAAHgAeABwAGgAbAB8AHAAdABUAFQAYABcAFAARABQAGQAWABEAEwASAA0AEwAQAA0AEQAQABMABwAHAAQA/v8CAP//AwD+//z/+//x//L/8v/x//L/9v/5//P/8P/x/+v/8P/o/+H/5//p/+L/3v/l/+n/7f/1/+//6//2//P/+f/9/wAA///z//H/8//v//D/7f/5//j/+f/8//7/BwAGAA4ADAAQAAsADQABAAEAAAAAAAQADQAOAA0AFgAZAB4AFAAgABcAIgAbAA8ADAAHABUADgARABcAFwAXACEAHgAoACgAIgAgACUAJgAhACQAIgAgABsAGwAYABQADAAZABYADwAWABMAGQANABEAEQAQAA4ABQAPAA0AEAAKAA8AFwAYABoAHAAfABEAFgAQABYAFwAdAB4AFwATABAAEAAPABYAEQAaABYAEAAKAAAABwAFAAMABQAAAAEA//8DAAEA/f8KAAAACAAAAPj/BAAAAAIA+P8AAPz//f/5//j/BQD//wAA/f/+//f/9//z//H/+f/0//n/+f/4//f/9P/v//P/8//1//b/8//w//X/7v/s/+z/5v/w//X/+f/r/+//8P/2//T/8//4//D/9P/t//L/9P/t/+z/7f/n/+X/6f/w/+n/6v/3//r/+f/3//T/7f/u/+z/7P/o/+v/7f/o/+L/5//l/+T/6P/t//P/5P/e/+n/7P/k/+D/7f/y//L/9P/n//P/8//0//X/8v/z/+7/8//v//P/8v/6//X/9f/y/+//8f/q/+z/9P/z//b/8f/w//v/AQACAP3////9/wwABgAIAA8ABgAMAAoADwAOAAkAEwATABQAFgAaABIACAAVABYAHQAXABU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kTzm/SX9Rb2AveG93j
" Your browser does not support the audio element.\n",
" </audio>\n",
" "
],
"text/plain": [
"<IPython.lib.display.Audio object>"
]
},
"execution_count": 9,
"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",
"version": "3.7.7"
}
},
"nbformat": 4,
"nbformat_minor": 4
}