SFML community forums

Help => Audio => Topic started by: schmitty on November 05, 2012, 06:53:52 pm

Title: [SOLVED]Spatialization of sound in 2D game (SFML 2.0)
Post by: schmitty on November 05, 2012, 06:53:52 pm
Hi I am having issues with spatialized sound in my 2D platformer. According to the tutorial
Quote
A sound can be spatialized only if it has a single channel, i.e. if it's a mono sound.

I believe my sound is stereo (.OGG format) so that would explain why the spatialization is not working. My question is: Can stereo sounds still work with the sf::listener class, particularly having sounds that are farther away played quieter? I have made a hacky work-around that calculates the sound volume based on distance from listener, but i'd like to use the built in SFML function if possible.

Thanks!
Title: Re: Spatialization of sound in 2D game (SFML 2.0)
Post by: Laurent on November 05, 2012, 06:56:29 pm
No. You can trust the tutorial ;)
Title: Re: Spatialization of sound in 2D game (SFML 2.0)
Post by: schmitty on November 05, 2012, 06:59:58 pm
Thanks for the speedy reply Laurent, you confirmed my suspicions.

Next question: is there anyway to convert audio files to mono within SFML, or do I need to use external audio software?

Thanks again!
Title: Re: Spatialization of sound in 2D game (SFML 2.0)
Post by: Laurent on November 05, 2012, 07:23:16 pm
You must use an external software.