Skip to content

Commit 22d204e

Browse files
committed
Fix: Update notebooks to use librosa.display.waveshow
This commit replaces the deprecated `librosa.waveplot()` with the current `librosa.display.waveshow` across the three analysis notebooks (chapters 8, 9, 10). The old function was causing the notebooks to fail. This update ensures they run correctly with the latest version of the librosa library.
1 parent b0ca26f commit 22d204e

File tree

3 files changed

+37
-43
lines changed

3 files changed

+37
-43
lines changed

10 - Fourier Transform - The Intuition/Fourier Transform.ipynb

Lines changed: 17 additions & 19 deletions
Large diffs are not rendered by default.

8- Implementing the amplitude envelope/Implementing the amplitude envelope.ipynb

Lines changed: 12 additions & 16 deletions
Large diffs are not rendered by default.

9- RMS energy and zero-crossing rate/RMS Energy and Zero-Crossing Rate.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"cell_type": "code",
178-
"execution_count": 10,
178+
"execution_count": null,
179179
"metadata": {},
180180
"outputs": [
181181
{
@@ -197,19 +197,19 @@
197197
"plt.figure(figsize=(15, 17))\n",
198198
"\n",
199199
"ax = plt.subplot(3, 1, 1)\n",
200-
"librosa.display.waveplot(debussy, alpha=0.5)\n",
200+
"librosa.display.waveshow(debussy, alpha=0.5)\n",
201201
"plt.plot(t, rms_debussy, color=\"r\")\n",
202202
"plt.ylim((-1, 1))\n",
203203
"plt.title(\"Debusy\")\n",
204204
"\n",
205205
"plt.subplot(3, 1, 2)\n",
206-
"librosa.display.waveplot(redhot, alpha=0.5)\n",
206+
"librosa.display.waveshow(redhot, alpha=0.5)\n",
207207
"plt.plot(t, rms_redhot, color=\"r\")\n",
208208
"plt.ylim((-1, 1))\n",
209209
"plt.title(\"RHCP\")\n",
210210
"\n",
211211
"plt.subplot(3, 1, 3)\n",
212-
"librosa.display.waveplot(duke, alpha=0.5)\n",
212+
"librosa.display.waveshow(duke, alpha=0.5)\n",
213213
"plt.plot(t, rms_duke, color=\"r\")\n",
214214
"plt.ylim((-1, 1))\n",
215215
"plt.title(\"Duke Ellington\")\n",
@@ -253,7 +253,7 @@
253253
},
254254
{
255255
"cell_type": "code",
256-
"execution_count": 13,
256+
"execution_count": null,
257257
"metadata": {},
258258
"outputs": [
259259
{
@@ -273,21 +273,21 @@
273273
"plt.figure(figsize=(15, 17))\n",
274274
"\n",
275275
"ax = plt.subplot(3, 1, 1)\n",
276-
"librosa.display.waveplot(debussy, alpha=0.5)\n",
276+
"librosa.display.waveshow(debussy, alpha=0.5)\n",
277277
"plt.plot(t, rms_debussy, color=\"r\")\n",
278278
"plt.plot(t, rms_debussy1, color=\"y\")\n",
279279
"plt.ylim((-1, 1))\n",
280280
"plt.title(\"Debusy\")\n",
281281
"\n",
282282
"plt.subplot(3, 1, 2)\n",
283-
"librosa.display.waveplot(redhot, alpha=0.5)\n",
283+
"librosa.display.waveshow(redhot, alpha=0.5)\n",
284284
"plt.plot(t, rms_redhot, color=\"r\")\n",
285285
"plt.plot(t, rms_redhot1, color=\"y\")\n",
286286
"plt.ylim((-1, 1))\n",
287287
"plt.title(\"RHCP\")\n",
288288
"\n",
289289
"plt.subplot(3, 1, 3)\n",
290-
"librosa.display.waveplot(duke, alpha=0.5)\n",
290+
"librosa.display.waveshow(duke, alpha=0.5)\n",
291291
"plt.plot(t, rms_duke, color=\"r\")\n",
292292
"plt.plot(t, rms_duke1, color=\"y\")\n",
293293
"plt.ylim((-1, 1))\n",

0 commit comments

Comments
 (0)