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

Support decoding as float32 #171

Open
northwind33 opened this issue Feb 6, 2025 · 0 comments
Open

Support decoding as float32 #171

northwind33 opened this issue Feb 6, 2025 · 0 comments

Comments

@northwind33
Copy link

Feature

Some workloads such as machine learning often require floating-point representations of audio waveforms. While it's technically possible to decode Opus packets to 16-bit PCM and then convert to float32, doing this conversion in JavaScript adds unnecessary overhead that slows down programs. libopus natively supports decoding to float32 through the opus_decode_float function, but this is not yet implemented in the current version. I believe adding this feature would be highly beneficial.

Ideal solution or implementation

Add binding support for libopus' opus_decode_float function to enable direct float32 output.

Alternative solutions or implementations

No response

Other context

I've already implemented this locally for my project, verified against PCM-to-float32 conversions with nearly identical results. May I open a PR with this?

northwind33 added a commit to northwind33/opus that referenced this issue Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant