You have to load in wav data and then use a callback to populate a buffer.
I’m pretty sure I’ve got an example somewhere, but it might be in C# rather than C++ and I’d have to dig it out.
(A long time ago I wrote a C# wrapper for SDL, but I never published it because then people would expect me to maintain it.
I’ve found the example I was thinking of and it is in C#.
I can PM it to you if you think it will be useful.
(And explain any C#-specific stuff that you might not be familiar with, but most of it speaks for itself, it’s only the
Marshal class that I think might be a bit confusing.)
I’ll have a dig around to see if I’ve got a C++ example of doing SDL audio, but I’m not sure if I do or not.
(I’ve got an SDL+OpenGL demo if it helps.
Looks like I don’t have any C++ examples, just the C# example.