Skip to content

Gate mel feature computation to reduce CPU during idle/silence #124

Description

@ysdede

Context

  • Mel worker continuously computes log-mel frames on every audio chunk.
  • This runs even when model is not ready or when no speech is detected.

Evidence

  • src/lib/audio/mel.worker.ts: pushAudio computes FFT+mel for every frame; no gating.
  • v4 path starts capture before model ready; mel still receives chunks.

Impact

  • High CPU from constant feature calculation during silence/idle.

Actions

  • Gate mel computation behind VAD or "model ready" state.
  • Allow a lower-rate mode when only preview is needed (downsample or skip frames).
  • Expose a toggle to pause mel worker when transcription is paused.

Acceptance

  • CPU usage during idle recording decreases significantly.
  • Trace shows fewer worker-active durations when model is not ready or silence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance optimization and profilingpriority:highImportant next work, impacts stability/performance/usability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions