Stream wav directly to audio speaker

closed account (GwTMDiN6)
Hi,

can anybody suggest a small lib for opening and passing on data from a wav file to speakers?
I already checked out WSAPI and SndLib. First one is to overloaded (for my taste) and I couldn't get SndLib to run on Win 10 (and it's not that WSAPI works the way I want ;)).

Actually I'm already able to open a wav file and store the data in my cpp program, but most of the libs I found, only provide the possibility to write data to a file.
I want to manipulate the floats directly and send them to an audio device inside my program.

Thx
SDL is more than what you're looking for, but it does provide cross-platform audio. There is a loadWav function that will get you the data into the buffer. You have direct access to the audio data buffer if you wish to do any audio processing, or you could completely synthesize audio and feed/queue that into the audio device.

There is also the additional library SDL_Mixer which brings the ability to load mp3, ogg, flac, midi and mod audio files. (though extracting the buffer data from these files is an extra step as you have to deal in "audio chunks" as the library describes them.

It is a lot more than what you're looking for since it's a full gui solutions package, but it is generally easy to use, is well documented with great tutorials, and it tries to stay close to the hardware where possible.
Last edited on
Topic archived. No new replies allowed.