Skip to main content
This example demonstrates how to use Agno agents to generate streaming audio responses using OpenAI’s GPT-4o audio preview model.

Key Features

  • Real-time Audio Streaming: Streams audio responses in real-time using OpenAI’s audio preview model
  • PCM16 Audio Format: Uses high-quality PCM16 format for audio streaming
  • Transcript Generation: Provides simultaneous text transcription of generated audio
  • WAV File Creation: Saves streamed audio directly to a WAV file format
  • Error Handling: Includes robust error handling for audio decoding

Use Cases

  • Interactive voice assistants
  • Real-time storytelling applications
  • Audio content generation
  • Voice-enabled chatbots
  • Dynamic audio responses for applications

Technical Details

The example configures audio streaming with 24kHz sample rate, mono channel, and 16-bit sample width. The streaming approach allows for real-time audio playback while maintaining high audio quality through the PCM16 format.