Skip to content

Commit

Permalink
Fix Deprecation/Future Warnings in Notebook 211-Speech-to-Text (openv…
Browse files Browse the repository at this point in the history
…inotoolkit#594)

* Fix deprecation/future warnings in notebook 211

- [`waveplot` is deprecated in favor of `waveshow` since librosa v0.9.](https://librosa.org/doc/latest/changelog.html?highlight=waveplot#v0-8-1)

  Note that `max_sr` in [`waveplot`](http://librosa.org/doc/0.8.1/generated/librosa.display.waveplot.html?highlight=max_sr#librosa.display.waveplot) is removed. `max_sr` controls how signals are down-sampled if they’re too long. (`waveplot` uses “a downsampled amplitude envelope” instead)

- `librosa.filters.mel` in `audio_to_mel`

  FutureWarning: Pass `sr=16000, n_fft=512` as keyword args. From version 0.10 passing these as positional arguments will result in an error.

* Fix `waveshow` Speech to text notebook 211

`max_points` should be an `int`, not `float`.

* add librosa to requirements

* Update .docker/Pipfile

* Update requirements.txt

Co-authored-by: Adrian Boguszewski <[email protected]>
  • Loading branch information
2 people authored and openvino-dev-samples committed Dec 6, 2022
1 parent 4dbb7c2 commit 4f54ec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notebooks/211-speech-to-text/211-speech-to-text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"outputs": [],
"source": [
"plt.figure()\n",
"librosa.display.waveplot(y=audio, sr=sampling_rate, max_points=50000.0, x_axis='time', offset=0.0, max_sr=1000);\n",
"librosa.display.waveshow(y=audio, sr=sampling_rate, max_points=50000, x_axis='time', offset=0.0);\n",
"plt.show()\n",
"specto_audio = librosa.stft(audio)\n",
"specto_audio = librosa.amplitude_to_db(np.abs(specto_audio), ref=np.max)\n",
Expand Down Expand Up @@ -288,7 +288,7 @@
" win_length=win_length, center=True, window=scipy.signal.windows.hann(win_length), pad_mode='reflect'))\n",
"\n",
" # Create mel filter-bank, produce transformation matrix to project current values onto Mel-frequency bins.\n",
" mel_basis = librosa.filters.mel(sampling_rate, 512, n_mels=64, fmin=0.0, fmax=8000.0, htk=False)\n",
" mel_basis = librosa.filters.mel(sr=sampling_rate, n_fft=512, n_mels=64, fmin=0.0, fmax=8000.0, htk=False)\n",
" return mel_basis, spec\n",
"\n",
"\n",
Expand Down

0 comments on commit 4f54ec9

Please sign in to comment.