Open luppichristian opened 1 month ago
I dunno, this feels feature-creepy to me.
This does start to get into the matrix coefficients territory, yeah - for something like this FAudio might work better:
Now that I think about a matrix would offer much more control. I think that implementing some sort of channel map or matrix would be a necessary feature for a good audio system. I get that SDL does not try to be a complete audio system but i think that it should provide at least one API to allow the user to dynamically modify the samples of an audio stream.
Right now the Audio API provides SDL_GetAudioStreamGain() and SDL_SetAudioStreamGain() that modify the gain of an audio stream.
It would be useful to implement SDL_SetAudioStreamGainChannelMap(), SDL_GetAudioStreamGainChannelMap() to specifically set the gain of a channel.
This allows the user to implement for example audio panning where the gain must be set dynamically and is often changed depending by the position of the sound in a custom world.
Instead of "Gain Channel Map" perhaps a better name would be "Panning Channel Map"