SFML community forums

Help => Audio => Topic started by: Barsay on January 13, 2020, 09:58:41 pm

Title: about getting an "internal audio stream"
Post by: Barsay on January 13, 2020, 09:58:41 pm
Hi everybody!
I'm looking for creating an "internal audio stream", and I'm wondering if I need to program it myself (and in that case, what do you suggest...), or if there already a solution and i just missed it.

Basically I need to get, in real-time, the samples that are currently being played by an audio stream. The goal is  to design a volume meter, an oscilloscope, or process the audio in real-time...

Is it any method to get from a buffer on play()?
A more "manual" solution could be to use the getSamples() function from the soundbuffer, reading the samples every 1/44.100th of second, sync them with the audio output from play()... but i'd like it to be more precise...
Any suggestions?
Is there some solution to get the currently streamed bits by the play() function?
Title: Re: about getting an "internal audio stream"
Post by: eXpl0it3r on January 14, 2020, 02:20:36 pm
You can write your own audio streams based on sf::SoundStream.

https://www.sfml-dev.org/tutorials/2.5/audio-streams.php