Skip to content

feat(audio): add optional Opus/Ogg codec package - #1068

Draft
David Elner (delner) wants to merge 1 commit into
feat/audio-recording-corefrom
feat/audio-codecs
Draft

David Elner (delner) wants to merge 1 commit into
feat/audio-recording-corefrom
feat/audio-codecs

Conversation

@delner

Copy link
Copy Markdown
Contributor

Based on #1067

Adds optional Opus encoding and Ogg container support so the shared recording pipeline. Install the extension alongside Braintrust and enabled recordings use Opus in Ogg automatically, with no encoder or middleware setup:

pip install braintrust-audio

Encoding can also be selected explicitly:

from braintrust.audio import AudioEncoding, AudioRecordingOptions

audio = AudioRecordingOptions(
    encoding=AudioEncoding(codec="opus", container="ogg"),
)
Session recording
  part-0.ogg   ▶ playable on its own
  part-1.ogg   ▶ playable on its own
  part-2.ogg   ▶ playable on its own

Design

flowchart LR
    C[Core audio contract] --> M[Optional codec middleware]
    M --> E[PyAV / Opus encoder]
    E --> O[Independent Ogg segments]
Loading
  • Native codec dependencies live in a separate distribution, to avoid adding additional constraints to the main SDK package.
  • The package includes codec round-trip tests and its own build/release CI.

Add the separate braintrust-audio distribution, independent Opus segments, codec qualification and dedicated build/release workflows. Keep native codec dependencies out of the core SDK.
@delner

Copy link
Copy Markdown
Contributor Author

Still very much a work in progress: this is just a first pass right now. Not sure if the packaging as-is is the right way to go.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant