SFML community forums

Help => Audio => Topic started by: jwurzer on December 06, 2017, 07:27:01 pm

Title: How many threads are created for multiple sf::Sound and/or sf::Music?
Post by: jwurzer on December 06, 2017, 07:27:01 pm
The tutorial page "Playing sounds and music" ( https://www.sfml-dev.org/tutorials/2.4/audio-sounds.php ) says that "Sounds (and music) are played in a separate thread."

Is there only one separate thread for all current used sf::Sound's and sf::Music's or create each sf::Sound and sf::Music its own thread?

Best regards
Title: Re: How many threads are created for multiple sf::Sound and/or sf::Music?
Post by: Laurent on December 06, 2017, 08:41:47 pm
There's (most likely, it's an internal detail of OpenAL Soft) a single thread for audio processing, plus one thread created by SFML for each sf::SoundStream (sf::Music).
Title: Re: How many threads are created for multiple sf::Sound and/or sf::Music?
Post by: jwurzer on December 06, 2017, 09:04:05 pm
Thank you for the info!

This means that a instance of sf::Sound (which is no derivation of sf::SoundStream) with a sf::SoundBuffer creates no additional thread (only the thread(s) which already exist for audio processing are used to play sf::Sound). Is that correct?
Title: Re: How many threads are created for multiple sf::Sound and/or sf::Music?
Post by: Laurent on December 06, 2017, 09:52:02 pm
That is correct, yes.