Skip to content

DataChannel stops transmitting audio after multiple manual interactions in real-time roleplay (auto turn detection disabled #556

@shailendra6D

Description

@shailendra6D

When I use manual start and stop recording with this code and set turn_detection: null, the audio stops sending after 2–3 messages. The RTCDataChannel either terminates or sometimes stays open, but no response is received. Occasionally, the issue happens even after just one message.

However, if I don’t pass turn_detection: null and also don’t manually trigger recording, everything works properly and the conversation continues without any issue

const response = await fetch("https://api.openai.com/v1/realtime/sessions", {
method: "POST",
headers: {
Authorization: Bearer ${apiKey},
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-4o-realtime-preview",
voice: "alloy",
instructions: instructionData,
modalities: ["audio", "text"],
input_audio_transcription: { model: 'whisper-1', language: 'hi', },
turn_detection: null,

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