Skip to content

Add Support for Constant Bitrate (CBR) in Opus Encoder #62

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

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

wys1024
Copy link

@wys1024 wys1024 commented Jun 17, 2025

Feature: Add support for Constant Bitrate (CBR) control

This PR adds the ability to configure whether the Opus encoder uses constant bitrate (CBR) or variable bitrate (VBR), which was previously unavailable in this Go binding.

Changes

  • Introduced SetCBR(cbr bool) to switch between CBR and VBR.
  • Introduced IsCBR() (bool, error) to query current setting.
  • Added C bridge functions: bridge_encoder_set_vbr and bridge_encoder_get_vbr.

Reason

Exposing this option allows developers to better control encoding behavior in constrained bitrate environments, particularly for VoIP or streaming use-cases.

Notes

This is a non-breaking change and fully backward compatible.

Thanks for your work on this project!

@wys1024
Copy link
Author

wys1024 commented Jun 19, 2025

@hraban Hi, would you mind taking a look when you get a chance? Thanks!

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