Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]Spatialization of sound in 2D game (SFML 2.0)  (Read 3469 times)

0 Members and 1 Guest are viewing this topic.

schmitty

  • Newbie
  • *
  • Posts: 6
    • View Profile
[SOLVED]Spatialization of sound in 2D game (SFML 2.0)
« 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!
« Last Edit: November 05, 2012, 07:47:10 pm by schmitty »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Spatialization of sound in 2D game (SFML 2.0)
« Reply #1 on: November 05, 2012, 06:56:29 pm »
No. You can trust the tutorial ;)
Laurent Gomila - SFML developer

schmitty

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Spatialization of sound in 2D game (SFML 2.0)
« Reply #2 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!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Spatialization of sound in 2D game (SFML 2.0)
« Reply #3 on: November 05, 2012, 07:23:16 pm »
You must use an external software.
Laurent Gomila - SFML developer

 

anything