Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello colleagues, my name is Mauro, and this is my first post. I've been testing 3d audio in irrKlang for several days, and in my testing, I can't get the audio to be heard behind the listener. this is my code: include <conio.h> include <stdio.h> include <irrKlang.h> using namespace irrklang; int main(int argc, const char** argv) { ISoundEngine* engine = createIrrKlangDevice(); if (!engine) return 0; // error starting up the engine vec3df position(0,0,0); ISound* music = engine->play3D("a.wav", position, true, true); if (music) music->setMinDistance(5.0f); music->setIsPaused(false); while(true) { engine->setListenerPosition(vec3df(0,0,0), vec3df(0,0,1)); int key = getch(); if (key == 27) break; if (key == 75) { position.X -= 0.15; music->setPosition(position); } if (key == 77) { position.X += 0.15; music->setPosition(position); } if (key == 72) { position.Y += 0.15; music->setPosition(position); } if (key == 80) { position.Y -= 0.15; music->setPosition(position); } } if (music) music->drop(); engine->drop(); // delete engine return 0; } sorry if i have mistakes, i'm still a beginner. Thanks a lot. |
||||
|
Didn't try your code, but how many speakers do you have? More than two? I guess if you don't have more than two, then this is basically impossible, isn't it? |
||||
|
Yes, I have two, but in several games I have, the audio is heard in 3d, and I can't create the same effect, although I don't know which library is being used, but I think it's the one for direc x, in pure basic . |
||||
|
You don't hear any 3d at all? Maybe you are not positioning yourself enough away from the source? |
|