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",
|
2021-04-29 16:04:32 +08:00
|
|
|
"from parakeet.utils import display\n",
|
2021-04-25 11:11:24 +08:00
|
|
|
"paddle.set_device(\"gpu:5\")\n",
|
|
|
|
"import sys\n",
|
|
|
|
"sys.path.append(\"/home/chenfeiyu/projects/Parakeet_0.2/\")"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 8,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"%matplotlib inline"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## 加载模型"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 11,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"from examples.ge2e.audio_processor import SpeakerVerificationPreprocessor\n",
|
|
|
|
"from parakeet.models.lstm_speaker_encoder import LSTMSpeakerEncoder\n",
|
|
|
|
"\n",
|
|
|
|
"# speaker encoder\n",
|
2021-04-29 16:04:32 +08:00
|
|
|
"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",
|
|
|
|
"speaker_encoder_params_path = \"/home/chenfeiyu/projects/Parakeet_0.2/examples/ge2e/runs/cn/checkpoints/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",
|
|
|
|
"from yacs.config import CfgNode\n",
|
|
|
|
"synthesizer = Tacotron2(\n",
|
|
|
|
" vocab_size=70,\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",
|
2021-04-29 16:04:32 +08:00
|
|
|
" use_stop_token=False,\n",
|
2021-04-25 11:11:24 +08:00
|
|
|
")\n",
|
|
|
|
"params_path = \"/home/chenfeiyu/projects/Parakeet_0.2/examples/tacotron2_aishell3/runs/debug/checkpoints/step-55000.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 = \"/home/chenfeiyu/projects/parakeet_examples/waveflow/step-2000000.pdparams\"\n",
|
|
|
|
"vocoder.set_state_dict(paddle.load(params_path))\n",
|
|
|
|
"vocoder.eval()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## 生成 speaker encoding"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 18,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"\n",
|
|
|
|
" <audio controls=\"controls\" >\n",
|
|
|
|
" <source src=\"data:audio/x-wav;base64,UklGRmaYBQBXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAATElTVDoAAABJTkZPSU5BTRcAAADnmb7luqbnp5HmioDlm60y5Y+35qW8AABJU0ZUDgAAAExhdmY1OC40NS4xMDAAZGF0YQC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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
" Your browser does not support the audio element.\n",
|
|
|
|
" </audio>\n",
|
|
|
|
" "
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
"<IPython.lib.display.Audio object>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 18,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# ref_audio_path = \"/home/chenfeiyu/datasets/aishell3/train/wav/SSB0011/SSB00110001.wav\"\n",
|
|
|
|
"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": 19,
|
|
|
|
"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": "code",
|
|
|
|
"execution_count": 20,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"['v', 'ien', 'd', 'e', 'b', 'iao', 'x', 'ian', 'x', 'ieng', 'sh', 'iii', '%', 'z', 'ai', 'uei', 'l', 'ai', '%', 'j', 'iang', 'b', 'ian', 'd', 'e', 've', 'l', 'ai', 've', 'zh', 'ueng', 'iao', '$']\n",
|
|
|
|
"['3', '1', '0', '5', '0', '3', '0', '4', '0', '2', '0', '4', '0', '0', '4', '4', '0', '2', '0', '0', '1', '0', '4', '0', '2', '4', '0', '2', '4', '0', '4', '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": 21,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stderr",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
" 35%|███▍ | 349/1000 [00:01<00:02, 233.91it/s]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"content exhausted!\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "stderr",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"<matplotlib.image.AxesImage at 0x7f8e32504f90>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 21,
|
|
|
|
"metadata": {},
|
|
|
|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ACYXUKKzrKYCF7KlJ6HmtpE3zeWfWxD8YYuZCHFXqZagqRBEShmC1VOfjfOdfygBZCr737anAG7hndTCu2pykUpg4dDHRnSS3TpjcHkLCui6zJe46g0SCFASJIJhRkmNxj7do2hqbtLjBxPQIbPrfs+jxXjcYGYcn1Oq5U8fLUa2euVHcXG2jKmiciheHQDSfd+l33mg9q4Q3cM+CSCKx9JKY8UxBaXBZGySTaFOWoVs7GNqt0JZHCy6uYaYCghkhmHVG3Xg84Yw4NuTiI8gpqQklNW5pOthHeOr0fDetomtJORYX22BV5z97PKuEN/DLncpYdFncWdJpJIpKRYUWmlUYtLYw/o7r6HuXxWRDJFBQwUaCGVQa+wyJlzNxr1pJTkN2MCQzNIsZmybqOXFuIX9cfBjcQF/oFrxJejxleANfi1S5xF/WMVRdL7pYeD42Zg0L1esei7i852wG3dJJ1JSm//ZGsm8bJJMIMWUTTKy6+/cpMJNPMvoqtD+dIDkVYEIXizYhNPZOYo71EY2NlwxZAlMqjG+jaMGp2qWcbG/aHk9VvIGvRS40fQ7Orb1RflcQ4nCtlG0zAdPvuZmTfxCyceMoTak8gVhmowSzYYKzYykKk0myJyD5yHoi1XPCE6JubLApVDpPTiFHX0Vnc3HYJY4LMxfW0JJRp+bts+J28HguU7yBrwXKix8V0+bKQwoVpUFLb4vrapTiwpIk6N7M1LUbGNyVJPPbQ9y4oR+DUlCDVXfsxkQOq4YfvRCy/v9SBCMd5AqKCRWJIGuVK/IWkyuQGDxL9Mpr587gq/jxULUstbJlqWSoN2iPZ0V4A681pUkoRYN2aWulsTpVwBLs2EbfXRuZ2JXjuiv76chM0p6aJojvO2JEsWo5Mp7nZH+
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 432x288 with 1 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",
|
2021-04-29 16:04:32 +08:00
|
|
|
"fig = display(outputs[\"alignments\"][0].numpy().T)"
|
2021-04-25 11:11:24 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## 合成语音"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 22,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"time: 12.234672784805298s\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"<matplotlib.collections.PolyCollection at 0x7f8e325bc150>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 22,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEGCAYAAABmXi5tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO2dd5gV1fnHv+82ll5XOiwi0pWygqAiqBRFIRo1qDHRxKhRo0YTs8auUUnsCTHKT6PEEmPU2EBEEUTpRTrSl470zsKW8/vj3llm751yZubMnZl738/z8HDL3Lln585855y3khACDMMwTPqTFfQAGIZhmNTAgs8wDJMhsOAzDMNkCCz4DMMwGQILPsMwTIaQE/QAzGjS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gRBiihBCu3JmAWjl9UtlpLaiUmCzywt2kUSdHLcz8u82xvadGJaYaT4BveD78afrj2ffJybjyxUxJ9f32+VbT/7u3eBs3WaH5J25m/DRwq2YJBGJ9NoM+ZlmKv7WwuLx+PC75NXcvR8swb/nbkSfxydL7+tQaTnmJIi0Fy5PuHlkBxC/erzC3xWlCsFvCWCT7vnm+Gtm/BLAZ0ZvENGNRDSPiObt3GmdjCMjjiu2H6hWTdMJUqWWPYqU1vVHm/Fkltw7z0R2ipaFXVpW4Xq1V6a4uY4qth+QmwnLSNani2MCPDNFoZGJM2kNv88Hp+x04Fcymli6yfDXy5offq2UOm2J6KcAigA8ZfS+EGKsEKJICFFUUFBguS8Zcbz+tbmebIN2Dju3Ttvvt8duQokf92OWu2jTPt/CxLziZKZthtVFpcWsvzHTfZG78oSqjkePV2BpiiK
|
|
|
|
"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": 23,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"\n",
|
|
|
|
" <audio controls=\"controls\" >\n",
|
|
|
|
" <source src=\"data:audio/wav;base64,UklGRgS6AgBXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YeC5AgCc//P/MABaAD4ARgBxAPH/LAAMAPn/Pw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AsARUAnP/U/uL+nv5X/6j/Zv8zAIL/SgDN/4sAXQBOAeQAmgJcAcMBkAHAAS4CtgL/A4MCggRXAS0CTAJ4AWkE5QDnAoEAoQAd/2T+uP58/bb/d/zv/cv54PtT+cn6Ffo9+136lvtf+5D6t/sU+sz8B/yf/2j+GwDk/igA9QD5ArACmQSZA4gFwQSZBScGjgWEB6kGdghACK0IRAfqB3gG3QfcBloHTQdPBvIFxgRJBNYD0wJTAicA8AAB/yQACP4o/fn78PkT++j4D/rH+G/4efcO98X1jPVQ9YP0rPSk893zOvN28nLzUPKj8/nyVPPL82jz1/QO9Zr1svWz9uv28vdW+Ej5cPqi+p37yPu8/Ff+5P1aAFEBjQI8BR8FgQfoB/MI4gqSC1ANGQ9iD0IRbhEJEUgSSxKWE94TdBPzE5kTdhOfEi0RmhCKEBwQqA5mDTsLuQlzCOQGeAaUBIQDZwL0AFcATf25+/L5DfkP+Sr4Ivc99cjzH/Kp8b3wRPHX8DrwRvCG70Xvfe8N79fvBu+j73rw3PD18T3x9/EI8jrzS/NS9In0mvWZ9U33Rvme+d362PkY+hr8K/39/7EBngLnA4UEAQf/CPsK8gu7DfMOyA/vEP4RXhNkFB4VtxUzF/wXpxjzGG8XmxjVF58YDhmIFzcZbBfiFbYUDRKqEt0SfRFvENY
|
|
|
|
" Your browser does not support the audio element.\n",
|
|
|
|
" </audio>\n",
|
|
|
|
" "
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
"<IPython.lib.display.Audio object>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 23,
|
|
|
|
"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-04-29 16:04:32 +08:00
|
|
|
"version": "3.7.5"
|
2021-04-25 11:11:24 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 4
|
|
|
|
}
|