Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process function should be deterministic. #46

Open
WenqingZong opened this issue Dec 9, 2024 · 0 comments
Open

process function should be deterministic. #46

WenqingZong opened this issue Dec 9, 2024 · 0 comments

Comments

@WenqingZong
Copy link
Collaborator

Currently we have some non-deterministic behavior in process function:

        for i in 0..num_chunks {
            let sample_range = if i < num_chunks - 1 {
                (self.processed_samples - self.deleted_samples)
                    ..(self.processed_samples + vad_segment_length - self.deleted_samples)
            } else {
                (self.processed_samples - self.deleted_samples)..self.session_audio.len()
            };
        // The rest of process function...
        }

The remainder size changes a lot, and this leads to an unsuccessful PR that checks the returned current_speech indeed include unprocessed samples - but now unprocessed is always 0.

A desired modification is deleting the last for iteration. If there are unprocessed samples, just keep them in internal buffer and wait for more samples to come.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant