API REFERENCE

SpectrogramStreamSource

The SpectrogramStreamSource type declaration and related types. Optional fields are marked with ?.

Type declaration

typescript
export interface SpectrogramStreamSource {
  push(frame: SpectrogramFrame): void;
  pushBatch(frames: ReadonlyArray<SpectrogramFrame>): void;
  shift(count: number): void;
  replace(frames: ReadonlyArray<SpectrogramFrame>): void;
  snapshot(): SpectrogramFrame[];
  latest(): SpectrogramFrame | undefined;
  subscribe(listener: (event: SpectrogramStreamEvent) => void): () => void;
  readonly length: number;
  readonly capacity: number;
  readonly dropped: number;
}