Skip to content

Why streaming process needn't call reset_states() after model process? #206

Answered by snakers4
MLrookie asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

In streaming process example, the model process a chunk audio of 250ms every time, but it don't use reset_states() after each process.

## using VADIterator class

vad_iterator = VADIterator(model)
wav = read_audio(f'en_example.wav', sampling_rate=SAMPLING_RATE)

window_size_samples = 1536 # number of samples in a single audio chunk
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

I believe that the example ha…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by snakers4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants
Converted from issue

This discussion was converted from issue #205 on July 18, 2022 04:00.