From d0139d94d98f5a31e254fed458b6b2a8a7f8ea09 Mon Sep 17 00:00:00 2001 From: GengYuchao Date: Wed, 11 Sep 2024 00:41:49 +0800 Subject: [PATCH] Fixed the pyaudio example can not run issue. Update the related packages. --- .../pyaudio-streaming-examples.ipynb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/pyaudio-streaming/pyaudio-streaming-examples.ipynb b/examples/pyaudio-streaming/pyaudio-streaming-examples.ipynb index da46792..94c8240 100644 --- a/examples/pyaudio-streaming/pyaudio-streaming-examples.ipynb +++ b/examples/pyaudio-streaming/pyaudio-streaming-examples.ipynb @@ -31,11 +31,11 @@ "metadata": {}, "outputs": [], "source": [ - "#!pip install numpy==1.20.2\n", - "#!pip install torch==1.9.0\n", - "#!pip install matplotlib==3.4.2\n", - "#!pip install torchaudio==0.9.0\n", - "#!pip install soundfile==0.10.3.post1\n", + "#!pip install numpy==2.0.2\n", + "#!pip install torch==2.4.1\n", + "#!pip install matplotlib==3.9.2\n", + "#!pip install torchaudio==2.4.1\n", + "#!pip install soundfile==0.12.1\n", "#!pip install pyaudio==0.2.11" ] }, @@ -61,7 +61,6 @@ "import torchaudio\n", "import matplotlib\n", "import matplotlib.pylab as plt\n", - "torchaudio.set_audio_backend(\"soundfile\")\n", "import pyaudio" ] }, @@ -162,7 +161,7 @@ "metadata": {}, "outputs": [], "source": [ - "num_samples = 1536" + "num_samples = 512" ] }, { @@ -180,6 +179,8 @@ "data = []\n", "voiced_confidences = []\n", "\n", + "frames_to_record = 50\n", + "\n", "print(\"Started Recording\")\n", "for i in range(0, frames_to_record):\n", " \n", @@ -296,7 +297,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -310,7 +311,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.9.10" }, "toc": { "base_numbering": 1,