Skip to content

Support decoding as float32 #171

@northwind33

Description

@northwind33

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions