Skip to content

Add Example of playing the audio received from p:openai_realtime_dart  #609

@oliverbytes

Description

@oliverbytes

Issue with current documentation:

Can someone please give an example on how to play the received audio file? I'm using just_audio and passed the Uint8list bytes as the source but it's playing like a noise output instead of the actual voice response. My code below

client.on(RealtimeEventType.conversationItemCompleted, (event) async {
    final item = (event as RealtimeEventConversationItemCompleted).item;
    final audio = item.formatted!.audio;
    await player.setAudioSource(AudioBytesSource(audio));
    await player.play();
  });

Idea or request for content:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions