Skip to content

Commit

Permalink
Merge pull request #182 from snakers4/adamnsandle
Browse files Browse the repository at this point in the history
Adamnsandle
  • Loading branch information
adamnsandle authored Apr 5, 2022
2 parents 6cc08b1 + 8cdc8d3 commit ea7af70
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions silero-vad.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@
"\n",
"window_size_samples = 1536 # number of samples in a single audio chunk\n",
"for i in range(0, len(wav), window_size_samples):\n",
" speech_dict = vad_iterator(wav[i: i+ window_size_samples], return_seconds=True)\n",
" chunk = wav[i: i+ window_size_samples]\n",
" if len(chunk) < window_size_samples:\n",
" break\n",
" speech_dict = vad_iterator(chunk, return_seconds=True)\n",
" if speech_dict:\n",
" print(speech_dict, end=' ')\n",
"vad_iterator.reset_states() # reset model states after each audio"
Expand All @@ -158,7 +161,10 @@
"speech_probs = []\n",
"window_size_samples = 1536\n",
"for i in range(0, len(wav), window_size_samples):\n",
" speech_prob = model(wav[i: i+ window_size_samples], SAMPLING_RATE).item()\n",
" chunk = wav[i: i+ window_size_samples]\n",
" if len(chunk) < window_size_samples:\n",
" break\n",
" speech_prob = model(chunk, SAMPLING_RATE).item()\n",
" speech_probs.append(speech_prob)\n",
"vad_iterator.reset_states() # reset model states after each audio\n",
"\n",
Expand Down

0 comments on commit ea7af70

Please sign in to comment.