QueueOverflowEvent
Emitted when an AudioBufferQueue drops chunks due to overflow.
Defined in: src/core/events/types.ts:823
Emitted when an AudioBufferQueue drops chunks due to overflow.
Remarks
This event fires each time the queue drops one or more chunks because it has reached its configured maxSize and the overflow strategy is 'drop-oldest' or 'drop-newest'. The event includes the queue name, the number of chunks dropped in this overflow instance, and the current buffer size after the drop.
Monitoring this event helps detect situations where the STT or output consumer is too slow to keep up with the producer, potentially causing audio gaps.
Example
agent.on('queue.overflow', (event) => {
console.warn(
`Queue "${event.queueName}" overflowed: ` +
`${event.droppedChunks} chunks dropped, ${event.currentSize} remaining`
);
});
See
- QueueStatsEvent for periodic pipeline health snapshots
- QueueEvent for all queue event types
Extends
BaseEvent
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
currentSize | number | Current number of chunks in the buffer after the drop. Remarks Equals the queue’s maxSize for 'drop-oldest' (the buffer remains full after replacing the oldest chunk). | - | src/core/events/types.ts:853 |
droppedChunks | number | Number of chunks dropped in this overflow instance. Remarks For 'drop-oldest' and 'drop-newest' strategies, this is typically 1 per overflow event. The cumulative total is available via QueueStatsEvent.totalDropped or QueueStats.totalDropped. | - | src/core/events/types.ts:844 |
metadata? | Record<string, unknown> | Optional metadata associated with the event. Remarks May contain provider-specific data or debugging information. | BaseEvent.metadata | src/core/events/types.ts:88 |
queueName | string | Diagnostic name of the queue that overflowed. Remarks Typically 'input' (between InputProvider and STT) or 'output' (between TTS and OutputProvider). | - | src/core/events/types.ts:834 |
timestamp | number | Unix timestamp (in milliseconds) when the event occurred. Remarks Useful for latency measurements and debugging the pipeline timing. | BaseEvent.timestamp | src/core/events/types.ts:80 |
type | "queue.overflow" | Discriminant for this event type. | - | src/core/events/types.ts:825 |