clearQueue() not setting queue size to 0
### Select which package(s) are affected
\@livekit/rtc-node
### Describe the bug
### Expected
After calling `clearQueue()`, I expect `queuedDuration` to be 0.
### Current
After calling `clearQueue()`, `queuedDuration` does not get set to 0.
### Reproduction
```typescript
// capture some frames...
audioSource.clearQueue()
console.log(audioSource.queuedDuration) // this will not be 0!
```
Can be avoided using a workaround:
```typescript
// capture some frames...
void audioSource.waitForPlayout()
audioSource.clearQueue()
console.log(audioSource.queuedDuration) // this will be 0 after `waitForPlayout()` returns
```
### Logs
```shell
```
### System Info
```shell
not relevant
```
### LiveKit server version
LiveKit cloud
### Severity
serious, but I can work around it
### Additional Information
_No response_
关闭于 2025-11-17 1 条评论