Is there a library for speaker output? I want to generate custom sound without using a .wav file. I'm hoping to (eventually) experiment with sound generation emulating the human voice.
Any audio library worth its salt has an option for streaming audio output. It usually works via a callback mechanism where you give it audio data (in the form of "samples") every so often.
Usually you obtain this audio data from a wav, mp3, or similar file. However if you want to generate your own audio, just feed it audio data you produce.
The data you give it is just normal, uncompressed PCM. Typically 16-bit signed, but there are a number of different formats you can use.
It looks like you just derive a class from SoundStream and implement the OnGetData function. You provide the audio data through the passed 'chunk' structure.
You then play the SoundStream through a sf::Sound (Sound::SetBuffer, then Sound::Play)