Skip to content

Issue: Audio is cut off randomly from AI responses (voice only) #73

@joslat

Description

@joslat

Hi, I was having some audio cutoffs while demo-ing this, so part of the audio was lost "somewhere"
Found this:
https://community.openai.com/t/realtime-audio-getting-abruptly-terminated-after-getting-audio-transcript-since-17th-jan/1097660/4
https://community.openai.com/t/realtime-api-audio-is-randomly-cutting-off-at-the-end/980587/44
this seems to be a probable solution (see image and link above)

I think this should "fix/mitigate" this:

 case ResponseDeltaType.AudioDone:
    Log.Info($"Received json: {responseDelta}");
    // Issue: Audio cutoff sometimes is too early, so we need to wait for trailing audio deltas
    // see https://community.openai.com/t/realtime-api-audio-is-randomly-cutting-off-at-the-end/980587/44
    await Task.Delay(100); // Some delay to receive trailing audio deltas

Thoughts? I'll make a PR for this 🙂
Ref Image:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions