ADDED: Audio stream processors support -WIP- #2212

This feature is still under consideration/testing and it doesn't work properly, at least the Delay Effect processor.
This commit is contained in:
Ray 2022-03-30 20:13:02 +02:00
parent 90fc7c0376
commit 1612ba63ab
3 changed files with 140 additions and 0 deletions

View file

@ -428,10 +428,12 @@ typedef struct Wave {
// Opaque structs declaration
// NOTE: Actual structs are defined internally in raudio module
typedef struct rAudioBuffer rAudioBuffer;
typedef struct rAudioProcessor rAudioProcessor;
// AudioStream, custom audio stream
typedef struct AudioStream {
rAudioBuffer *buffer; // Pointer to internal data used by the audio system
rAudioProcessor *processor; // Pointer to internal data processor, useful for audio effects
unsigned int sampleRate; // Frequency (samples per second)
unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
@ -1543,6 +1545,9 @@ RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan
RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data
RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
#if defined(__cplusplus)
}
#endif