Skip to content

Commit

Permalink
integer in indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
genisplaja committed Apr 19, 2024
1 parent e17b972 commit 63fd675
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webbook/introduction/compiam.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@
"audio, sr = our_track.audio\n",
"\n",
"# Plotting waveform\n",
"pitch_frames = (segment_in_seconds*sr) * 0.01\n",
"pitch_frames = int(segment_in_seconds * sr * 0.01)\n",
"plot_pitch(\n",
" pitch=predicted_pitch[:pitch_frames, 1],\n",
" times=predicted_pitch[:pitch_frames, 0],\n",
");\n",
"\n",
"# Playing 10 seconds of audio used for prediction\n",
"audio_samples = segment_in_seconds * sr\n",
"audio_samples = int(segment_in_seconds * sr)\n",
"audio_short = audio[:, :audio_samples]\n",
"ipd.Audio(\n",
" data=audio_short,\n",
Expand All @@ -452,7 +452,7 @@
"from compiam.visualisation.pitch import plot_pitch\n",
"\n",
"# Plotting waveform\n",
"pitch_frames = (segment_in_seconds*sr) * 0.01 ## 0.01 is the chosen step\n",
"pitch_frames = int(segment_in_seconds * sr * 0.01) ## 0.01 is the chosen step\n",
"pitch_values = predicted_pitch[:pitch_frames, 1]\n",
"pitch_values[pitch_values < 20] = None\n",
"plot_pitch(\n",
Expand All @@ -461,7 +461,7 @@
");\n",
"\n",
"# Playing 10 seconds of audio used for prediction\n",
"audio_samples = segment_in_seconds * sr\n",
"audio_samples = int(segment_in_seconds * sr)\n",
"audio_short = audio[:, :audio_samples]\n",
"ipd.Audio(\n",
" data=audio_short,\n",
Expand Down

0 comments on commit 63fd675

Please sign in to comment.