Problem using alxPlay, to play ambient sound effects
by Mike Stoddart · in Torque Game Engine · 08/11/2002 (8:24 pm) · 8 replies
I have basic sounds in my game, including footsteps and weapon fire sounds. I thought I'd try to add an ambient sound file that is looped indefinitely until the player leaves the mission.
So I'm using this audioprofile:
Here's the entry in my mission file:
And here's the code that plays the sound:
The strange thing is, the ambient sound doesn't play, but neither do that normal game sounds (footsteps and weapons) that played before I added this code.
Now I'm not too worried about the ambient sound not working, as I can just remove the code. But I don't understand why my regular game sounds don't work anymore.
Any ideas?
Thanks
So I'm using this audioprofile:
Quote:datablock AudioDescription(AudioLooping2D)
{
volume = 1.0;
isLooping = true;
is3D = false;
type = $SimAudioType;
};
Here's the entry in my mission file:
Quote: new AudioProfile(AmbientSound)
{
filename = "~/data/missions/town2test/sounds/ambient.wav";
description = "AudioLooping2D";
preload = false;
};
And here's the code that plays the sound:
Quote:%player.ambientSoundHandle = alxCreateSource(AmbientSound);
alxPlay(%player.ambientSoundHandle);
The strange thing is, the ambient sound doesn't play, but neither do that normal game sounds (footsteps and weapons) that played before I added this code.
Now I'm not too worried about the ambient sound not working, as I can just remove the code. But I don't understand why my regular game sounds don't work anymore.
Any ideas?
Thanks
#2
08/12/2002 (7:15 am)
Nope, there are no errors and the sound datablocks are defined in different files.
#3
12/01/2002 (6:08 pm)
This is exactly the same thing that has happened to me. No errors show up in the console.log either. It also shows that the OpenAL drivers have been loaded. Mike - have you figured this out yet (it's been a few months since your last post).
#4
12/01/2002 (6:37 pm)
Brad, sorry I didn't find a solution.
#5
edit: Note that you don't need to have all of those in there. The cones, for example, are useless with 2dambient. Also, "type = '0'" should either not be in there, or be set to one of the other variables (ie: simAudioType). The good news is that you should be able to create the entire audioprofile from that single statement in the mission file, without needing to have outside datablocks. On the flip side,if you do use those datablocks, make sure you have 'useProfileDescription = "1"; '
Just as is with 90% of Torque, you may have to do some trial and error to get it just right.
--Eric
12/02/2002 (2:25 am)
I don't understand why you are going that route, when it can simply be done in the mission file. This is from Trajectory Zonenew AudioEmitter(AmbientJungle) {
position = "-163.538 177.59 60.2155";
rotation = "1 0 0 0";
scale = "1 1 1";
description = "AudioLooping2D";
fileName = "~/data/sound/environment/ambientjungle.wav";
useProfileDescription = "0";
outsideAmbient = "1";
volume = "1";
isLooping = "1";
is3D = "0";
referenceDistance = "1";
maxDistance = "1.01";
coneInsideAngle = "360";
coneOutsideAngle = "360";
coneOutsideVolume = "1";
coneVector = "0 0 1";
loopCount = "-1";
minLoopGap = "0";
maxLoopGap = "0";
type = "0";
minDistance = "20.0";
};Also, make sure your "type" is different from the other level audio. If the audioprofile for the music is "simaudiotype", then define a new one called "musicaudiotype" to use strictly with music files.edit: Note that you don't need to have all of those in there. The cones, for example, are useless with 2dambient. Also, "type = '0'" should either not be in there, or be set to one of the other variables (ie: simAudioType). The good news is that you should be able to create the entire audioprofile from that single statement in the mission file, without needing to have outside datablocks. On the flip side,if you do use those datablocks, make sure you have 'useProfileDescription = "1"; '
Just as is with 90% of Torque, you may have to do some trial and error to get it just right.
--Eric
#6
12/02/2002 (11:19 am)
I noticed this same problem. I tried to create sounds for the precipitation and lightning game objects, which also seems to be using the ambient sound engine, and they won't work either. I created audiodescription & audioprofile blocks for these objects to use, but all sound is removed from the game when I do this. I'm pretty certain they also use the alxplay functions. Can I create special audioemitters for these objects like Eric mentions, because I've only read how to use audiodescriptions and profiles for them.
#7
http://www.garagegames.com/projectmanager/issue.php?qis=194
If you can't get to this link for some reason, here is the link to the website that has the older version of OpenAL32.dll that will fix the problem:
http://tork.zenkel.com/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=5
12/09/2002 (5:54 pm)
Good news! I just saw on the open issues list this exact problem. And even better, there is a link to a website that has the fix. There is a problem with Torque working with newer versions of OpenAL. This link has a link in it that has the correct version of OpenAL32.dll which will solve the problem. Thank goodness - i thought i was losing my mind!http://www.garagegames.com/projectmanager/issue.php?qis=194
If you can't get to this link for some reason, here is the link to the website that has the older version of OpenAL32.dll that will fix the problem:
http://tork.zenkel.com/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=5
#8
@ brad:
both links are not working.
but anyway have you solved this problem??
can you reactivate theese likns??
thank you.
08/30/2005 (3:02 am)
Ok guys i know i am coming too late to this thread, i mean after 3 years . but..... .@ brad:
both links are not working.
but anyway have you solved this problem??
can you reactivate theese likns??
thank you.
Torque 3D Owner Robert Blanchet Jr.
The best bet to track this down is to look through the console in the game and see if there are any errors.