realtime_audio 0.0.7 copy "realtime_audio: ^0.0.7" to clipboard
realtime_audio: ^0.0.7 copied to clipboard

Audio package to handle streaming chunk playback & recording to use with realtime APIs like OpenAI Realtime, Elevenlabs, HumeAI Voice and others.

🎡 Realtime Audio #

RealtimeAudio is a Flutter package that handles audio recording and playback of data chunks from real-time sources, like OpenAI Realtime, ElevenLabs or HumeAI Voice.

✨ Features #

  • 🎀 Audio recording with variable chunk length in milliseconds.
  • πŸ”Š Audio playback of data chunks.
  • ⏱️ Duration tracking of audio chunks.
  • ⏸️ Pause support.
  • πŸ“Š Volume tracking in dBFS.
  • πŸŽ›οΈ Voice isolation and other processing on iOS.
  • πŸ“± iOS audio session handling for max volume.
  • πŸ€–πŸπŸŽ Android, iOS, and macOS support.
  • βœ‚οΈ Audio response truncation support.

πŸ“– Usage #

To use this package, add realtime_audio as a dependency in your pubspec.yaml file.

After initializing the RealtimeAudio object, you can start recording and playing audio chunks by calling start().

Audio will be played back in real-time, as soon as the first chunk is queued with queueChunk().

See the example project for a complete example.

πŸ”’ Permissions #

πŸ€– Android #

  • Add Permissions to AndroidManifest.xml:

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    

🍏 iOS #

  • Add Permissions to Info.plist: Open your Info.plist file and add the following keys:

    <key>NSMicrophoneUsageDescription</key>
    <string>We need access to the microphone to record audio.</string>
    

🍎 macOS #

  • Add Permissions to Info.plist: Open your Info.plist file and add the following keys:

    <key>NSMicrophoneUsageDescription</key>
    <string>We need access to the microphone to record audio.</string>
    
  • Add Entitlements to release and debug macos/*.entitlements: Open your macos/*.entitlements file and add the following:

    <key>com.apple.security.device.audio-input</key>
    <true/>
    

    Can also do this through XCode by selecting the target, then Signing & Capabilities, then checking Audio Input.

4
likes
140
points
618
downloads

Publisher

verified publishervolskaya.dev

Weekly Downloads

Audio package to handle streaming chunk playback & recording to use with realtime APIs like OpenAI Realtime, Elevenlabs, HumeAI Voice and others.

Repository (GitHub)
View/report issues

Topics

#ai #audio #openai #elevenlabs #hume

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

collection, flutter, freezed_annotation, json_annotation, uuid

More

Packages that depend on realtime_audio