Skip to content

Conversation

@avezina-ubik
Copy link

In order to support deep PLC, libopus added OPUS_SET_COMPLEXITY() to the decoder API.

This PR adds SetComplexity method to the decoder.

Note that if libopus < 1.5 this function will return ErrUnimplemented so users could easily ignore it like this:

dec, err := opus.NewDecoder(48000, 1)
if err != nil {
	// ... handle error
}

err = dec.SetComplexity(10)
if err != nil && err != opus.ErrUnimplemented {
	// ... handle error
}

@avezina-ubik
Copy link
Author

This should help #54

@jackspirou
Copy link

@hraban curious if this can be merged?

@hraban
Copy link
Owner

hraban commented Feb 13, 2025

Yes looks great sorry I forgot but it's on my radar will restore my go dev env in a bit

@gregriff
Copy link

gregriff commented Nov 6, 2025

this would be a great addition!

@hraban
Copy link
Owner

hraban commented Nov 17, 2025

Thank you for the PR! I added some tests in CI and rebased your change on top of it and it seems to be failing. See e.g. https://github.com/hraban/opus/actions/runs/19424167437 . Do you know what could be going wrong?

@avezina-ubik
Copy link
Author

Hey @hraban ,

I just checked the build logs and it seems the workflows are using libopus from Ubuntu 24.04, which is version 1.4.

This PR depends on a feature that was first implemented in libopus 1.5.

Ubuntu 25.04 ships with libopus 1.5.2, which would work: https://answers.launchpad.net/ubuntu/plucky/amd64/libopus-dev

Would you like me to include an updated test.yml in this PR that runs the jobs in an ubuntu:25.04 container? That would allow us to test the new functionality.

@hraban
Copy link
Owner

hraban commented Nov 17, 2025

ah thanks that explains it. I'll have another look on my end tonight, see if I can get it merged.

@avezina-ubik
Copy link
Author

All right let me know if you need something

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.

4 participants