How to add simple sound to a model?
by GarageGamer · in Torque Game Engine · 03/31/2004 (11:35 am) · 5 replies
I have the SDK, I need to add a simple looping sound to a animal model in torque, i've tried adding them to my animal script files but i cannot get them to play.
datablock AudioProfile(WoodPecker)
{
filename = "~/data/sound/fx/birds/woodpecker.wav";
description = AudioSound3d;
preload = true;
};
// And using this in audioprofiles
datablock AudioDescription(AudioSound3d)
{
volume = 1.0;
isLooping= true;
is3D = true;
minDistance= 10.0;
referenceDistance = 10.0;
MaxDistance= 250.0;
type = $EffectAudioType;
};
I was wondering if i needed to add a sound function in the engine in order to get my audioprofile to work like for the footsteps for the default player. Like this for example for a type of footsound for the player.
addField("FootSoftSound", TypeAudioProfilePtr, Offset(sound[FootSoft], PlayerData));
My audioprofile works with ambient sounds using audio emitters, but i can't them to play on a model. All i really need is to have the sound attached to the model where ever it goes. Thanks if anyone can help.
datablock AudioProfile(WoodPecker)
{
filename = "~/data/sound/fx/birds/woodpecker.wav";
description = AudioSound3d;
preload = true;
};
// And using this in audioprofiles
datablock AudioDescription(AudioSound3d)
{
volume = 1.0;
isLooping= true;
is3D = true;
minDistance= 10.0;
referenceDistance = 10.0;
MaxDistance= 250.0;
type = $EffectAudioType;
};
I was wondering if i needed to add a sound function in the engine in order to get my audioprofile to work like for the footsteps for the default player. Like this for example for a type of footsound for the player.
addField("FootSoftSound", TypeAudioProfilePtr, Offset(sound[FootSoft], PlayerData));
My audioprofile works with ambient sounds using audio emitters, but i can't them to play on a model. All i really need is to have the sound attached to the model where ever it goes. Thanks if anyone can help.
About the author
#2
03/31/2004 (1:56 pm)
I was told by others who could help to post them in the forums that i posted them in, so i don't consider it spamming.
#3
03/31/2004 (2:24 pm)
Posting the same question in 4 or 5 forums at the same time is spamming.
#4
function woodpecker::onAdd(%this,%obj)
{
%obj.PlayAudio(1,WoodPecker);
}
But you have serverPlay2d and 3d to
-Billy
03/31/2004 (3:02 pm)
Try something like thisfunction woodpecker::onAdd(%this,%obj)
{
%obj.PlayAudio(1,WoodPecker);
}
But you have serverPlay2d and 3d to
-Billy
#5
04/01/2004 (11:14 am)
We all read all the forums. please post each question only once. I will delete your other posts for you.
Torque Owner John Vanderbeck
VanderGames