❓ Questions Do you support realtime streaming input data? #504
-
❓ Questions and HelpWe have a wiki available for our users. Please make sure you have checked it out first. Hi, snakers4. Your system can control Realtime splited input data? totla input_data size = 160000 samples std::vector input(16000); Then i couldn't get result. Do you have any function to control realtime input data to get vad? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, We have a real-time example in python - https://github.com/snakers4/silero-vad/blob/master/src/silero_vad/utils_vad.py#L383-L471 It is very naïve and it does not take into account all of the heuristics used in an offline example, but it's a good start. Note that the VAD is not stateless. |
Beta Was this translation helpful? Give feedback.
-
From the colab example Stream imitation exampleusing VADIterator classvad_iterator = VADIterator(model, sampling_rate=SAMPLING_RATE)
wav = read_audio(f'en_example.wav', sampling_rate=SAMPLING_RATE)
window_size_samples = 512 if SAMPLING_RATE == 16000 else 256
for i in range(0, len(wav), window_size_samples):
chunk = wav[i: i+ window_size_samples]
if len(chunk) < window_size_samples:
break
speech_dict = vad_iterator(chunk, return_seconds=True)
if speech_dict:
print(speech_dict, end=' ')
vad_iterator.reset_states() # reset model states after each audio just probabilitieswav = read_audio('en_example.wav', sampling_rate=SAMPLING_RATE)
speech_probs = []
window_size_samples = 512 if SAMPLING_RATE == 16000 else 256
for i in range(0, len(wav), window_size_samples):
chunk = wav[i: i+ window_size_samples]
if len(chunk) < window_size_samples:
break
speech_prob = model(chunk, SAMPLING_RATE).item()
speech_probs.append(speech_prob)
vad_iterator.reset_states() # reset model states after each audio
print(speech_probs[:10]) # first 10 chunks predicts |
Beta Was this translation helpful? Give feedback.
Hi,
We have a real-time example in python - https://github.com/snakers4/silero-vad/blob/master/src/silero_vad/utils_vad.py#L383-L471
It is very naïve and it does not take into account all of the heuristics used in an offline example, but it's a good start.
Note that the VAD is not stateless.