Skip to content

Example for Closed Captioning and muting output audio #480

@gblikas

Description

@gblikas

Please read this first

  • Have you read the docs? Agents SDK docs
  • Have you searched for related issues? Others may have had similar requests

Describe the feature

We need an example on how to properly use the agents sdk to mute output audio and provide CC via the "output_text_delta". It seems like something in the session is blocking the muting of output audio, and the event "listeners" for "output_text_delta" don't fire.

The example should be minimal, but the SDK changes needed should be complete.

Additional Context

{
  "dependencies": {
   "@openai/agents-realtime": "^0.1.2"
  }
}
const transport = new OpenAIRealtimeWebRTC({
          mediaStream,
          audioElement: audioEl,
          model: 'gpt-realtime',
        });

        const agent = new RealtimeAgent({
          name: 'Voice Q&A',
          instructions: buildInstructions(),
        });

        const session = new RealtimeSession(agent, {
            model: 'gpt-realtime',
            config: {
              turnDetection: {
                type: 'semantic_vad',
                eagerness: 'medium',
                createResponse: true,
                interruptResponse: true,
              },
            },
          });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions