Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opus format with Ogg codec for BufferStream #161

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft

Opus format with Ogg codec for BufferStream #161

wants to merge 24 commits into from

Conversation

alnitak
Copy link
Owner

@alnitak alnitak commented Dec 29, 2024

Description

BufferType to use in setBufferStream, now support also opus as data type. When adding audio chunks using addAudioDataStream using Opus, it now expects to receive a stream of an Opus file.
This can be useful for example when you have a stream coming from a network and you want to play it in real-time. Tested with the Opus coming from OpenAI's Text-To-Speech APIs.

To achieve this I've used Xiph Ogg and Opus libraries.

working on

  • Linux
  • Android
  • Windows
  • iOS should compile on simulator and device and run (cannot try)
  • MacOS compiles on x86_64. Should compile on arm. Should run (cannot try)
  • Web

Use external Xiph libraries where possible:

  • Linux
  • MacOS

This means the opus and ogg libraries are embedded in iOS, Android, and Windows. On MacOS and Linux, you should install them with brew install libogg opus or with your distribution's package manager. If not installed, it compiles anyway, but it will throw if you want to use the opus streaming feature.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant