Schedule a Sound File
by Danny Wyatt · in Torque Game Engine · 05/02/2006 (9:59 am) · 3 replies
I am trying to schedule a sound file to play during the game and I need the correct way to do this. I'm calling it like this but it's not working.
schedule(1000, alxPlay, EnviroSound);
EnvrioSound is the sound Profile.
any help is greatly appreciated, thanks.
schedule(1000, alxPlay, EnviroSound);
EnvrioSound is the sound Profile.
any help is greatly appreciated, thanks.
About the author
#2
At the top of client/audioProfiles.cs
Somewhere in server/audioprofiles.cs
Some of the commands available to you through script
To schedule
05/02/2006 (10:19 am)
I'm assuming you've set up your audio correctly, it should look something like thisAt the top of client/audioProfiles.cs
// Channel assignments (channel 0 is unused in-game). $GuiAudioType = 1; $SimAudioType = 2; $MessageAudioType = 3; $EnviroAudioType = 4;
Somewhere in server/audioprofiles.cs
datablock AudioDescription(EnvironmentSounds)
{
volume = 1.0;
isLooping= true;
is3D = false;
type = $EnviroAudioType;
};
datablock AudioProfile(myEnviroSound)
{
filename = "~/data/sound/myEnviroSound.ogg";
description = EnvironmentSounds;
preload = true;
};Some of the commands available to you through script
$EnviroHandle = alxPlay(myEnviroSound); //play the sound alxStop($EnviroHandle); //stop the sound
To schedule
function playEnviroSound()
{
$EnviroHandle = alxPlay(myEnviroSound);
}
schedule(1000, "playEnviroSound");
#3
05/03/2006 (5:18 am)
Thanks ! Yes I do have my description and profile set up but the function you've got there works perfect. Thanks again.
Torque Owner Stefan Lundmark
And most likely also add "" marks to your argument, ie:
Have fun!