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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - castled

Pages: [1]
1
Audio / Re: Audio Spatialization exclusively left/right intended?
« on: January 28, 2017, 09:11:32 pm »
Oh, thanks Hapax! That works perfectly. I should have realized it would need to work that way since it's designed for 3D scenes.

2
Audio / Re: Audio Spatialization exclusively left/right intended?
« on: January 28, 2017, 08:44:24 pm »
Thanks, your example shows the issue more clearly. Yeah I figured this was just an OpenAL thing. It's too bad there isn't a way to simply specify the volume of the left/right channels but I suppose OpenAL isn't made for that. I guess I'll work around this by not spatializing sounds until they're further from the player in my game. Not ideal but having sounds switch from one mode to the other will be less common.

3
Audio / Re: Audio Spatialization exclusively left/right intended?
« on: January 25, 2017, 10:15:53 pm »
Hmm, I am still hearing this issue, here is a minimal example. Even if I put the sound 0.0001f to the right, it is only audible through the right speaker. Either something is wrong with my sound driver or this is intended?

#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Window");

        sf::SoundBuffer buffer;
        buffer.loadFromFile("bullet.wav");
        sf::Sound sound;
        sound.setBuffer(buffer);

        while(true)
        {
                sf::Event e;
                while (window.pollEvent(e))
                {
                        if (e.type == sf::Event::KeyPressed)
                        {
                                switch (e.key.code)
                                {
                                case sf::Keyboard::Left:
                                        sound.setPosition(-1.0f, 0, 0);
                                        break;
                                case sf::Keyboard::Right:
                                        sound.setPosition(1.0f, 0, 0);
                                        break;
                                case sf::Keyboard::Space:
                                        sound.setPosition(0, 0, 0);
                                        break;
                                case sf::Keyboard::Escape:
                                        return 0;
                                }
                                sound.play();
                        }
                }
        }
       
        return 0;
}
 

Also, unrelated, I hear something that may be a bug. Using the above program it seems that setPosition doesn't immediately take effect. That is, if I press left to position it on the left, then press right, I do hear a little blip out of the left speaker. Pressing right further times won't produce anything from the left speaker.

4
Audio / Re: Audio Spatialization exclusively left/right intended?
« on: January 25, 2017, 09:21:53 pm »
Sounds like you're saying that my issue is not the intended behavior. Maybe my values are incorrect (I haven't touched attenuation yet), I will play with them and make a minimal example if I still can't fix it. Thanks!

5
Audio / Audio Spatialization exclusively left/right intended?
« on: January 25, 2017, 09:04:42 pm »
Hi, just a quick question on whether this is the intentional behavior or if I am doing something wrong.

When I position a sound very slightly left of the listener, it plays exclusively from the left speaker. This can be jarring when a sound or the listener moves from one side to the other. Ideally it would play from both speakers if it was close to the listener and slowly move to being just left/right as it got further away. Is this always the expected behavior or are my sound/listener parameters incorrect?

Pages: [1]