diff options
author | Chris Robinson <[email protected]> | 2023-03-07 13:30:15 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-07 13:30:15 -0800 |
commit | ed6b8230bd1f4ac502ce4915d24fedacf3eceee0 (patch) | |
tree | c7766a230fc26a2322ebd472a8022286f544545b /include | |
parent | f11313c62dd6ab8666023e90dc6fbf3fc70cb1da (diff) |
Add queries for the buffer byte/sample/sec length
These used to exist with the now-defunct AL_SOFT_buffer_samples extension, this
just restores those queries without extra baggage.
The sample length query are necessary when handling ADPCM buffers, since the
size/channels*8/bits calculation is incorrect with ADPCM. 'Bits' is usually
reported as 4 since most samples in a block are stored as nibbles, but that's
only approximate and doesn't account for the block header. The average number
of bits per sample in an ADPCM block can't be represented as an integer, so the
more blocks there are stored in the buffer, the more inaccurate the calculation
becomes.
Diffstat (limited to 'include')
-rw-r--r-- | include/AL/alext.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/AL/alext.h b/include/AL/alext.h index 5d04a839..ae899315 100644 --- a/include/AL/alext.h +++ b/include/AL/alext.h @@ -391,6 +391,13 @@ AL_API void AL_APIENTRY alProcessUpdatesSOFT(void); /*#define AL_SEC_LENGTH_SOFT 0x200B*/ #endif +#ifndef AL_SOFT_buffer_length_query +#define AL_SOFT_buffer_length_query 1 +/*#define AL_BYTE_LENGTH_SOFT 0x2009*/ +/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/ +/*#define AL_SEC_LENGTH_SOFT 0x200B*/ +#endif + #ifndef ALC_SOFT_pause_device #define ALC_SOFT_pause_device 1 typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device); |