-
Notifications
You must be signed in to change notification settings - Fork 311
Description
Related discussion
Discussion #1734
Is your feature request related to a problem?
The Windows WASAPI driver in exclusive mode is unable to use the full resolution of a 24 bit DAC if the audio hardware does not accept samples in IEEE floating point format.
Describe the solution you'd like
This issue proposes adding end-to-end support for signed 32-bit linear PCM output in FluidSynth, exposed via audio.sample-format="32bits", with an initial focus on the WASAPI driver.
The goal is to allow the synth rendering API to deliver 32-bit integer PCM directly to drivers that can negotiate and transport this format (notably WASAPI exclusive mode), while preserving existing behavior for all other formats and drivers.
Describe alternatives you've considered
Allow the WASAPI driver to probe for and use hardware transport formats that support 24 bits or better when audio.sample-format is set to "float".
Additional context
The following tasks are proposed:
- Refactor integer output rendering to a shared C++11 templated implementation
- Port the current
fluid_synth_write_s16(_channels)implementation to C++ using the existing DSP carve-out pattern (C ABI wrappers + C++ implementation). - Preserve existing 16-bit behavior bit-for-bit, including dithering.
- Port the current
- Add
fluid_synth_write_s32(_channels)to the public synth rendering API- Signed 32-bit PCM (
int32_t) - round + clip conversion from internal floating-point samples
- no dithering
- API shape parallel to the existing s16 and float variants.
- Signed 32-bit PCM (
- Add support for
audio.sample-format="32bits"influid_wasapi.c- Select the 32-bit PCM render path when requested.
- Ensure correct format negotiation in shared and exclusive modes.
- Extend
fluid_wasapi_device_enumerate.cto probe and report 32-bit PCM support- Probe 32-bit PCM formats where appropriate (notably in exclusive mode).
- Reflect support in the device / format enumeration results.
- Confirm driver behavior for unrecognized
audio.sample-formatvalues- WASAPI: handled as part of tasks 3–4.
- Android drivers: confirmed to fall back to 16-bit PCM; no behavior change proposed.
- Other drivers: no action required.