Game Development Community

alxSetChannelVolume problem

by Aditya Kulkarni · in Torque Game Builder · 07/12/2010 (6:40 am) · 1 replies

When I call changeLevelSoundVolume(), I get alxSetChannelVolume: channel '144' out of range [0, 32]. Now where the heck did it get '144' from?

in my common/gamescripts/audio.cs
$levelSound = 6;
new AudioDescription(AudioChannel6)
{
   volume = 1.0;
   isLooping = false;
   is3D = false;
   type = $levelSound;
};

in game/gamescripts/audioDatablocks.cs
new AudioDescription(levelStartSound) {
   volume = 1;
   isLooping= false;
   is3D = false;
   type = $levelSound;
};

function changeLevelSoundVolume(%volume) {
   echo ("changeLevelSound: "@%volume);
   if(%volume>=0&&%volume<=1) {
      alxSetChannelVolume($levelSound, %volume);
   }
}

Help appreciated, dil se.

#1
07/12/2010 (6:51 am)
Frustrated the whole evening by this one, and once again I found the answer after posting.

I was using $levelSound as the handle...:(
$levelSound = alxPlay(%sound);