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 - obernardovieira

Pages: [1]
1
Audio / Re: Spatialization error!
« on: August 06, 2013, 10:20:36 pm »
"A sound can be spatialized only if it has a single channel, i.e. if it's a mono sound.
Spatialization is disabled for sounds with more channels, since they already explicitly decide how to use the speakers. This is very important to keep in mind."

so, i can't spatialize sounds like it?  :-\
My objective was to make something like teamspeak but specialized to enter into a game

2
Audio / Re: Spatialization error!
« on: August 06, 2013, 09:19:28 pm »
I think not, and I read some things about it but did not understand much  :-[ or nothing!

this is the sound -

PS. I'm listening to the speakers of my computer

3
Audio / Spatialization error!
« on: August 06, 2013, 08:33:18 pm »
not understand why, but it does not work, already researched everything on google, I do not see any error in the code, but the sound is played as if playing a song on the computer
can someone help me?

#include <SFML\Audio.hpp>
#include <iostream>
#include <chrono>
#include <thread>

bool iniciarsom(const std::string &nomeficheiro) {
        sf::Music musica;
        if(musica.openFromFile(nomeficheiro)) {
                musica.setPosition(10.f, 1.f, 1.f);
                musica.setRelativeToListener(false);
                musica.setMinDistance(15.f);
                musica.setAttenuation(10.f);
                musica.play();
                //std::this_thread::sleep_for(std::chrono::seconds((int)musica.getDuration().asSeconds()));
                std::this_thread::sleep_for(std::chrono::seconds(5));
        }
        else {
                std::cout << "Erro ao abrir ficheiro" << std::endl;
                return false;
        }
        return true;
}

bool main() {
        // Move the listener to the position (1, 0, -5)
        sf::Listener::setPosition(20.f, 1.f, 1.f);
        // Make it face the right axis (1, 0, 0)
        sf::Listener::setDirection(0.f, 1.f, 0.f);
        // Reduce the global volume
        sf::Listener::setGlobalVolume(90.f);



        std::thread musica(iniciarsom,"c:\\musica.wav");
        musica.detach();
        std::this_thread::sleep_for(std::chrono::seconds(4));
        system("pause");
    return true;
}

Pages: [1]
anything