AlListener3f Question...
by Chris Cockcroft · in Torque Game Builder · 01/25/2006 (3:11 am) · 2 replies
I'm playing around with the sound functions built into Torque, and having no knowledge of OpenAL, I'm not fairing too well :)
From what I can tell from looking around online, I should be able to set the position of the listener object.
I've tried two ways of calling the alListener3f function (not at the same time):
but each way gives me an "alListener3f: wrong number of arguments" error when the call is made. Is there something else I need to do before calling this function?
Is it even possible to get positional sound in T2D? I'm not looking for anything too complicated, simple volume gain when the player object approaches certain sound sources - that kind of thing.
Thanks for any help in advance :)
Chris
From what I can tell from looking around online, I should be able to set the position of the listener object.
I've tried two ways of calling the alListener3f function (not at the same time):
alListener3f( "AL_POSITION", "0.0 0.0 0.0" ); alListener3f( "AL_POSITION", 0.0, 0.0, 0.0 );
but each way gives me an "alListener3f: wrong number of arguments" error when the call is made. Is there something else I need to do before calling this function?
Is it even possible to get positional sound in T2D? I'm not looking for anything too complicated, simple volume gain when the player object approaches certain sound sources - that kind of thing.
Thanks for any help in advance :)
Chris
About the author
#2
You know, I even looked at that line thinking maybe that's where the problem was, but thought it looked fine :P Now I can go back to frustrating myself with OpenAL :)
Chris
02/04/2006 (4:45 am)
Thanks Simon!You know, I even looked at that line thinking maybe that's where the problem was, but thought it looked fine :P Now I can go back to frustrating myself with OpenAL :)
Chris
Torque Owner Simon Love
In your file audiofunctions.cc, in the consolemethod allistener3f, find the line
if(argc != 3 || argc != 5)// Here! { Con::errorf(ConsoleLogEntry::General, "alListener3f: wrong number of arguments"); return; }Should be changed to
if(argc != 3 && argc != 5) // Notice the && Here! { Con::errorf(ConsoleLogEntry::General, "alListener3f: wrong number of arguments"); return; }Still way too many bugs with the openAL implementation in T2D (and TGE), but we'll get through it!