Skip to content

Audio Playback of Agent message is too fast #73

@jpvajda

Description

@jpvajda

When clicking on the audio playback for the agent message the rate of speech is to fast, it sounds like a chipmunk.

The Problem:

  • Deepgram output sample rate: 24000 Hz (line 95 in WebSocketContext.tsx)
  • Playback button sample rate: 48000 Hz (line 41 in MessageAudio.tsx)

When you tell AudioContext the audio is 48kHz but it's actually 24kHz, it plays back at 2x speed = chipmunk voice!

Possible Fix:

const audioBuffer = audioContext.createBuffer(
  1,
  audioDataView.length,
  24000  // ← Change from 48000 to 24000
);

Why live playback sounds fine:
The real-time playback during conversation uses proper scheduling in WebSocketContext.tsx which handles the sample rate correctly. Only the replay button has the hardcoded mismatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions