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

send silence when no data is captured #272

Merged
merged 4 commits into from
Dec 21, 2023
Merged

send silence when no data is captured #272

merged 4 commits into from
Dec 21, 2023

Conversation

theomonnom
Copy link
Member

No description provided.

if inner.captured_frames > 0 {
break; // User captured something, stop injecting silence
if let Some(last_capture) = inner.last_capture {
if last_capture.elapsed() < Duration::from_millis(20) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20ms instead of 10?
Not sure if this is the best way to handle it but it avoid to inject silence if the user is 1ms late

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20ms seems fine. we would inject 10ms worth of silence?

we should have a break condition still somewhere right? when the source is destroyed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes 10ms of silence every 10ms
blah I'm tired.. yeah I should stop the task

Copy link
Contributor

@keepingitneil keepingitneil Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense but I don't know enough about what this means for jitter buffer behavior. Basically every time you stop sending audio the pipeline will have 10ms of jitter introduced?

edit: nvm, so 10ms is introduced and then it immediately catches back up to whatever it considers healthy buffer size becuase we'll just send 10ms instantly after that.

@theomonnom theomonnom requested a review from davidzhao December 19, 2023 23:27
@theomonnom theomonnom merged commit ab5b49c into main Dec 21, 2023
12 of 15 checks passed
@theomonnom theomonnom deleted the theo/send-silence branch December 21, 2023 02:09
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

Successfully merging this pull request may close these issues.

3 participants