SFML community forums

Help => Audio => Topic started by: Plento on March 05, 2023, 03:55:06 am

Title: Disable automatic attack with Sound.play() ?
Post by: Plento on March 05, 2023, 03:55:06 am
Hello, I've been using sfml to play raw audio data and I found that using Sound.play() automatically adds a small attack (around 4 ms) to the sound (I assume to prevent clicks and pops). Is there any way to disable this feature? If this isn't what's going on, is there a reason this is happening?

The attached image, shows two sine waves played back to back. You can see where one ends and the other starts because its "ramping up" the volume over a short time, which I'd like to remove.
My code simply fills an audio buffer with a sine wave. No attack code on my end.

Thank you!
Title: Re: Disable automatic attack with Sound.play() ?
Post by: eXpl0it3r on March 05, 2023, 06:17:10 pm
Hmm there was a discussion once, but unfortunately I could find it (only found this one (https://en.sfml-dev.org/forums/index.php?topic=9176.0)), which I believe tracked it back to an issue in OpenAL-soft, as such I'd recommend to try and update openal-soft to the latest version (consider rebuilding SFML) and see if the issue persists.
Title: Re: Disable automatic attack with Sound.play() ?
Post by: Plento on March 06, 2023, 07:12:26 am
I rebuilt SFML from source which didn't change anything unfortunately. I'm unfamiliar with openal-soft, how would I go about updating it for SFML?
Title: Re: Disable automatic attack with Sound.play() ?
Post by: eXpl0it3r on March 06, 2023, 09:53:27 am
You can grab the source and build it from source as well and then replace the files in extlibs (for Windows or macOS): https://github.com/kcat/openal-soft