|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "62a0cccb", |
| 5 | + "id": "76aa55ba", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# Pyaudio Microphone Streaming Examples\n", |
|
12 | 12 | "I created it as an example on how binary data from a stream could be feed into Silero VAD.\n", |
13 | 13 | "\n", |
14 | 14 | "\n", |
15 | | - "Has been tested on Ubuntu 21.04 (x86). After you installed the dependencies below, no additional setup is required." |
| 15 | + "Has been tested on Ubuntu 21.04 (x86). After you installed the dependencies below, no additional setup is required.\n", |
| 16 | + "\n", |
| 17 | + "This notebook does not work in google colab! For local usage only." |
16 | 18 | ] |
17 | 19 | }, |
18 | 20 | { |
19 | 21 | "cell_type": "markdown", |
20 | | - "id": "64cbe1eb", |
| 22 | + "id": "4a4e15c2", |
21 | 23 | "metadata": {}, |
22 | 24 | "source": [ |
23 | 25 | "## Dependencies\n", |
|
26 | 28 | }, |
27 | 29 | { |
28 | 30 | "cell_type": "code", |
29 | | - "execution_count": null, |
30 | | - "id": "57bc2aac", |
31 | | - "metadata": {}, |
| 31 | + "execution_count": 1, |
| 32 | + "id": "24205cce", |
| 33 | + "metadata": { |
| 34 | + "ExecuteTime": { |
| 35 | + "end_time": "2024-10-09T08:47:34.056898Z", |
| 36 | + "start_time": "2024-10-09T08:47:34.053418Z" |
| 37 | + } |
| 38 | + }, |
32 | 39 | "outputs": [], |
33 | 40 | "source": [ |
34 | | - "#!pip install numpy==2.0.2\n", |
35 | | - "#!pip install torch==2.4.1\n", |
36 | | - "#!pip install matplotlib==3.9.2\n", |
37 | | - "#!pip install torchaudio==2.4.1\n", |
| 41 | + "#!pip install numpy>=1.24.0\n", |
| 42 | + "#!pip install torch>=1.12.0\n", |
| 43 | + "#!pip install matplotlib>=3.6.0\n", |
| 44 | + "#!pip install torchaudio>=0.12.0\n", |
38 | 45 | "#!pip install soundfile==0.12.1\n", |
39 | | - "#!pip install pyaudio==0.2.11" |
| 46 | + "#!apt install python3-pyaudio (linux) or pip install pyaudio (windows)" |
40 | 47 | ] |
41 | 48 | }, |
42 | 49 | { |
43 | 50 | "cell_type": "markdown", |
44 | | - "id": "110de761", |
| 51 | + "id": "cd22818f", |
45 | 52 | "metadata": {}, |
46 | 53 | "source": [ |
47 | 54 | "## Imports" |
48 | 55 | ] |
49 | 56 | }, |
50 | 57 | { |
51 | 58 | "cell_type": "code", |
52 | | - "execution_count": null, |
53 | | - "id": "5a647d8d", |
54 | | - "metadata": {}, |
55 | | - "outputs": [], |
| 59 | + "execution_count": 2, |
| 60 | + "id": "994d7f3a", |
| 61 | + "metadata": { |
| 62 | + "ExecuteTime": { |
| 63 | + "end_time": "2024-10-09T08:47:39.005032Z", |
| 64 | + "start_time": "2024-10-09T08:47:36.489952Z" |
| 65 | + } |
| 66 | + }, |
| 67 | + "outputs": [ |
| 68 | + { |
| 69 | + "ename": "ModuleNotFoundError", |
| 70 | + "evalue": "No module named 'pyaudio'", |
| 71 | + "output_type": "error", |
| 72 | + "traceback": [ |
| 73 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 74 | + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", |
| 75 | + "Cell \u001b[0;32mIn[2], line 8\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpylab\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mplt\u001b[39;00m\n\u001b[0;32m----> 8\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpyaudio\u001b[39;00m\n", |
| 76 | + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pyaudio'" |
| 77 | + ] |
| 78 | + } |
| 79 | + ], |
56 | 80 | "source": [ |
57 | 81 | "import io\n", |
58 | 82 | "import numpy as np\n", |
|
67 | 91 | { |
68 | 92 | "cell_type": "code", |
69 | 93 | "execution_count": null, |
70 | | - "id": "725d7066", |
| 94 | + "id": "ac5c52f7", |
71 | 95 | "metadata": {}, |
72 | 96 | "outputs": [], |
73 | 97 | "source": [ |
|
79 | 103 | { |
80 | 104 | "cell_type": "code", |
81 | 105 | "execution_count": null, |
82 | | - "id": "1c0b2ea7", |
| 106 | + "id": "ad5919dc", |
83 | 107 | "metadata": {}, |
84 | 108 | "outputs": [], |
85 | 109 | "source": [ |
|
92 | 116 | }, |
93 | 117 | { |
94 | 118 | "cell_type": "markdown", |
95 | | - "id": "f9112603", |
| 119 | + "id": "784d1ab6", |
96 | 120 | "metadata": {}, |
97 | 121 | "source": [ |
98 | 122 | "### Helper Methods" |
|
101 | 125 | { |
102 | 126 | "cell_type": "code", |
103 | 127 | "execution_count": null, |
104 | | - "id": "5abc6330", |
| 128 | + "id": "af4bca64", |
105 | 129 | "metadata": {}, |
106 | 130 | "outputs": [], |
107 | 131 | "source": [ |
|
124 | 148 | }, |
125 | 149 | { |
126 | 150 | "cell_type": "markdown", |
127 | | - "id": "5124095e", |
| 151 | + "id": "ca13e514", |
128 | 152 | "metadata": {}, |
129 | 153 | "source": [ |
130 | 154 | "## Pyaudio Set-up" |
|
133 | 157 | { |
134 | 158 | "cell_type": "code", |
135 | 159 | "execution_count": null, |
136 | | - "id": "a845356e", |
| 160 | + "id": "75f99022", |
137 | 161 | "metadata": {}, |
138 | 162 | "outputs": [], |
139 | 163 | "source": [ |
|
147 | 171 | }, |
148 | 172 | { |
149 | 173 | "cell_type": "markdown", |
150 | | - "id": "0b910c99", |
| 174 | + "id": "4da7d2ef", |
151 | 175 | "metadata": {}, |
152 | 176 | "source": [ |
153 | 177 | "## Simple Example\n", |
|
157 | 181 | { |
158 | 182 | "cell_type": "code", |
159 | 183 | "execution_count": null, |
160 | | - "id": "9d3d2c10", |
| 184 | + "id": "6fe77661", |
161 | 185 | "metadata": {}, |
162 | 186 | "outputs": [], |
163 | 187 | "source": [ |
|
167 | 191 | { |
168 | 192 | "cell_type": "code", |
169 | 193 | "execution_count": null, |
170 | | - "id": "3cb44a4a", |
| 194 | + "id": "23f4da3e", |
171 | 195 | "metadata": {}, |
172 | 196 | "outputs": [], |
173 | 197 | "source": [ |
|
207 | 231 | }, |
208 | 232 | { |
209 | 233 | "cell_type": "markdown", |
210 | | - "id": "a3dda982", |
| 234 | + "id": "fd243e8f", |
211 | 235 | "metadata": {}, |
212 | 236 | "source": [ |
213 | 237 | "## Real Time Visualization\n", |
|
220 | 244 | { |
221 | 245 | "cell_type": "code", |
222 | 246 | "execution_count": null, |
223 | | - "id": "05ef4100", |
| 247 | + "id": "d36980c2", |
224 | 248 | "metadata": {}, |
225 | 249 | "outputs": [], |
226 | 250 | "source": [ |
|
230 | 254 | { |
231 | 255 | "cell_type": "code", |
232 | 256 | "execution_count": null, |
233 | | - "id": "d1d4cdd6", |
| 257 | + "id": "5607b616", |
234 | 258 | "metadata": {}, |
235 | 259 | "outputs": [], |
236 | 260 | "source": [ |
|
287 | 311 | { |
288 | 312 | "cell_type": "code", |
289 | 313 | "execution_count": null, |
290 | | - "id": "1e398009", |
| 314 | + "id": "dc4f0108", |
291 | 315 | "metadata": {}, |
292 | 316 | "outputs": [], |
293 | 317 | "source": [ |
|
311 | 335 | "name": "python", |
312 | 336 | "nbconvert_exporter": "python", |
313 | 337 | "pygments_lexer": "ipython3", |
314 | | - "version": "3.9.10" |
| 338 | + "version": "3.10.14" |
315 | 339 | }, |
316 | 340 | "toc": { |
317 | 341 | "base_numbering": 1, |
|
0 commit comments