SFML community forums

Help => Audio => Topic started by: Gregory on October 10, 2013, 09:39:59 pm

Title: How sf::Music internally works
Post by: Gregory on October 10, 2013, 09:39:59 pm
Hello guys. How the sf::Music internally works? It uses a double buffer? Whilte playing one it push the data to the other and swap than each x samples?

I wanna make a "audio editing" software that you can put effects in real time, so my idea is to apply the effects over the standby buffer so when it get swaped it will player with affects already applyed. After each swap I go and apply the effect again over the standby buffer.

SFML have some way to make this work? maybe I can make it directly using openAL?

thanks
Title: Re: How sf::Music internally works
Post by: binary1248 on October 10, 2013, 10:10:17 pm
https://github.com/SFML/SFML
Browse the code. It is faster and more explanatory than any text that would get written here.
Title: Re: How sf::Music internally works
Post by: Gregory on October 11, 2013, 04:33:38 am
I will give a look. Someone knows the size of the buffer chunks? My current ideia is use a custom soundStream that apply the effects at each chunk update.
Title: Re: How sf::Music internally works
Post by: zsbzsb on October 11, 2013, 04:56:56 am
I will give a look. Someone knows the size of the buffer chunks? My current ideia is use a custom soundStream that apply the effects at each chunk update.

Just read the official tutorial (http://www.sfml-dev.org/tutorials/2.1/audio-streams.php). If anything is unclear then feel free to ask  ;)
Title: Re: How sf::Music internally works
Post by: Laurent on October 11, 2013, 07:29:53 am
Quote
I will give a look. Someone knows the size of the buffer chunks?
Please have a look first, and then ask questions :P