Skip to content

Commit

Permalink
refresh timeout if not done
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp committed Sep 18, 2024
1 parent 99abc28 commit cc63478
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/livekit-rtc/src/audio_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export class AudioSource {
currentQueueSize: number;
/** @internal */
releaseQueue = new Queue<void>();
/** @internal */
timeout?: ReturnType<typeof setTimeout> = undefined;

sampleRate: number;
numChannels: number;
Expand Down Expand Up @@ -96,6 +98,9 @@ export class AudioSource {
this.currentQueueSize -= 0.05
this.lastCapture = now

if (this.timeout) {
clearTimeout(this.timeout);
}
setTimeout(this.releaseQueue.put, this.currentQueueSize)

const req = new CaptureAudioFrameRequest({
Expand Down

0 comments on commit cc63478

Please sign in to comment.