Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
3d audio is not heard behind the aubriculars

maurosebastian91
Registered User
Quote
2021-03-09 22:45:30

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.


floranz
Guest
Quote
2021-03-10 12:41:58

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?


maurosebastian91
Registered User
Quote
2021-03-10 15:58:19

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 .


erik
Registered User
Quote
2021-03-11 08:00:36

You don't hear any 3d at all? Maybe you are not positioning yourself enough away from the source?


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact