Sound FX will not work?
by Caylo Gypsyblood · in Torque Game Engine · 12/14/2006 (3:04 am) · 8 replies
I have some OGG files. They work fine if replace the 'datablock AudioProfile(CrossbowFireSound)' with the file name of the sound FX i want to use in a script file. BUT from the script they will not play. I have no idea what the problem is... Matter of fact, up untill this stage, evrything with Torque have been fun to work with. But SOUND? no... its a pain in the fking ass..... ( this is after over 3 days pecking at the same problem like a monkey trying get a shiny object out of a tinny hole...)
#2
It's no secret that Torque's sound layer has caused many nightmares for developers. Weird stuff happens, things I've yet to track down and fix in three years of poking at the sound layer. .ogg files will stop playing for no reason at all, after working in the previous test run.
Some sounds even switch completely, i.e. playing an explosion sound when the reload sound should be playing, despite NO script changes. I usually have to restart, rebuild, and recompile the .dso files and everything returns to normal.
I'm looking into replacing the sound layer with something like FMod, but I haven't gathered enough bravery to attempt it yet, though I know others have.
12/14/2006 (6:47 am)
@Caylo - Def. post the script so we can see how you are setting up the datablock and playing the sound.It's no secret that Torque's sound layer has caused many nightmares for developers. Weird stuff happens, things I've yet to track down and fix in three years of poking at the sound layer. .ogg files will stop playing for no reason at all, after working in the previous test run.
Some sounds even switch completely, i.e. playing an explosion sound when the reload sound should be playing, despite NO script changes. I usually have to restart, rebuild, and recompile the .dso files and everything returns to normal.
I'm looking into replacing the sound layer with something like FMod, but I haven't gathered enough bravery to attempt it yet, though I know others have.
#3
then inside a function i put:
The ogg file will work just fine if i rename any of the sound FX in the crossbow.cs script.
They should put a warning on the SDK, something like "Our implementation of Open AL is only there to cause you harm."
12/14/2006 (12:21 pm)
First i have a CS i name EFX, at the top i have;datablock AudioProfile(EQsound)
{
filename = "~/data/sound/environment/LongEQA01.ogg";
description = AudioDefault3d;
preload = false;
};then inside a function i put:
$Qsound = alxplay( EQsound);
The ogg file will work just fine if i rename any of the sound FX in the crossbow.cs script.
They should put a warning on the SDK, something like "Our implementation of Open AL is only there to cause you harm."
#4
The transform is the position on the map like "0 0 0 0 0 0"
This alxplay(EQsound) you use if you play a 2dsound .
12/14/2006 (12:44 pm)
If you play this sound on the map , then you must use alxplay(profile,transform); ex. $Qsound = alxplay(EQsound,"-100 100 10");
The transform is the position on the map like "0 0 0 0 0 0"
This alxplay(EQsound) you use if you play a 2dsound .
#5
Are you sure you're executing the script containing your audio profiles?
12/14/2006 (12:52 pm)
@CayloAre you sure you're executing the script containing your audio profiles?
#6
But i need to hear this sound from anyplace on the map, not just from where it spawn.
Scott, Yes. I alredy checked all the 'logical' things.
I think the biggest problem with Torques Open AL is the BAD (ok none...) documentation, and looking in the code did not clue me in about how to use the sound functions.
12/14/2006 (1:18 pm)
Billy, Thanks. It indeed play now that i add $Qsound = alxplay(EQsound,$CONPLAY.gettransform()); But i need to hear this sound from anyplace on the map, not just from where it spawn.
Scott, Yes. I alredy checked all the 'logical' things.
I think the biggest problem with Torques Open AL is the BAD (ok none...) documentation, and looking in the code did not clue me in about how to use the sound functions.
#7
Your AudioProfile is set to 3d if you want it as a 2Dsound use a 2Dprofile.
But if you use it as 2D then use alxplay(profile) only !
Or make a new 3Ddescription with a bigger maxdistans.
12/14/2006 (1:44 pm)
The thing is do you want it to play as a 3Dsound or a 2Dsound ?Your AudioProfile is set to 3d if you want it as a 2Dsound use a 2Dprofile.
But if you use it as 2D then use alxplay(profile) only !
Or make a new 3Ddescription with a bigger maxdistans.
#8
Its only a 3d sound, as i was copying exactly the way the sound DID work useing the profile and everything from crossbow.cs. I have used other profiles, mater of fact ALL of them were in that place at one time or other.
12/14/2006 (2:19 pm)
Yes yes, i dont CARE how it play. I just want it to play!Its only a 3d sound, as i was copying exactly the way the sound DID work useing the profile and everything from crossbow.cs. I have used other profiles, mater of fact ALL of them were in that place at one time or other.
Torque 3D Owner Billy L
So how do you setup the script to play the sound.