New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for user defined sound effect implementations. #2973
Conversation
39720e1
to
b208967
Compare
Is there anything we can do to reduce the code duplication between Sound.cpp and SoundStream.cpp? |
Pull Request Test Coverage Report for Build 9122177114Details
馃挍 - Coveralls |
Not really... most of the duplicated code references internal members of |
b208967
to
769f723
Compare
769f723
to
36cf4ff
Compare
Rebased onto master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly nitpicks
36cf4ff
to
cc1dc77
Compare
Updated with @vittorioromeo's suggestions. |
c51d7fb
to
497a453
Compare
497a453
to
42c1b0c
Compare
Rebased on |
42c1b0c
to
ab71ace
Compare
615dca9
to
37402db
Compare
37402db
to
5ac3dee
Compare
Title.
Because I found it a pity that #1708 had to be closed due to the miniaudio rewrite and all of @fallahn's work gone to waste, I went ahead and implemented equivalent (maybe even better?) support for user defined sound effects in the spirit of aforementioned PR.
The example has been accordingly extended with demonstrations of how to use the new API to implement basically any effect one can think of. I am by no means a DSP expert (the example implementations were taken from people far more knowledgeable than me 馃榿), so maybe someone can improve the example processing code or even add more interesting effects.
All of the action happens when an effect processor is attached to an
sf::SoundSource
using:The effect processor is passed the raw audio data from the engine and can manipulate it before sending it back to be output through the audio device. Refer to the
sf::SoundSource
documentation and sound effects example for detailed information on API usage.