mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-17 23:31:47 +00:00
[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.
This commit is contained in:
@@ -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
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user