diff options
| author | Jeffery Myers <[email protected]> | 2021-03-21 14:07:55 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-21 22:07:55 +0100 |
| commit | b573ff3e7a998592d705f5e81b7217ccae44f2a5 (patch) | |
| tree | c21277f1d4e3aa15ed3e591d1bbb07250f85bdf4 /src/config.h | |
| parent | c37f61d31f10c9ea23cf4f3e4bfd2069dafbe4eb (diff) | |
| download | raylib-b573ff3e7a998592d705f5e81b7217ccae44f2a5.tar.gz raylib-b573ff3e7a998592d705f5e81b7217ccae44f2a5.zip | |
[AUDIO] Use device native sample rates (#1660)
* Init MinAudio to a sample rate of 0 to let the device pick the rate.
Read the rate from the device after it starts up.
Convert AUDIO_DEVICE_SAMPLE_RATE from a #def into an int, that is set from the device's rate
Set all sample systems to use the AUDIO_DEVICE_SAMPLE_RATE as the target rate to minimize resampling.
* use device sample rate instead of separate var
let config define a device sample rate if it wants to, but let the default be 0 for native rate.
* Don't use fixed sample rates for tracker files.
Remove config default audio buffer size and replace with a function that computes one for a reasonable frame rate at the output sample rate.
Diffstat (limited to 'src/config.h')
| -rw-r--r-- | src/config.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/config.h b/src/config.h index c2997854..748a53e1 100644 --- a/src/config.h +++ b/src/config.h @@ -195,9 +195,8 @@ //------------------------------------------------------------------------------------ #define AUDIO_DEVICE_FORMAT ma_format_f32 // Device output format (miniaudio: float-32bit) #define AUDIO_DEVICE_CHANNELS 2 // Device output channels: stereo -#define AUDIO_DEVICE_SAMPLE_RATE 44100 // Device output sample rate +#define AUDIO_DEVICE_SAMPLE_RATE 0 // Device sample rate (device default) -#define DEFAULT_AUDIO_BUFFER_SIZE 4096 // Default audio buffer size for streaming #define MAX_AUDIO_BUFFER_POOL_CHANNELS 16 // Maximum number of audio pool channels //------------------------------------------------------------------------------------ |
