= Audio::NumAudioTypes) { Con::errorf(ConsoleLogEntry::General,"> Bug in audio controls? | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Bug in audio controls?

by David Stewart Zink · in Torque Game Engine · 02/14/2002 (8:56 am) · 1 replies

F32 mAudioTypeVolume[Audio::NumAudioTypes];
ConsoleFunction(alxGetChannelVolume, S32, 2, 2, "alxGetChannelVolume(channel_id)")
{
   U32 type = dAtoi(argv[1]);
   if(type >= Audio::NumAudioTypes)
   {
      Con::errorf(ConsoleLogEntry::General, "alxGetChannelVolume: invalid channel '%d'", dAtoi(argv[1]));
      return(0.f);
   }

   return(mAudioTypeVolume[type]);
}
F32 volume = mClampF(dAtof(argv[2]), 0.f, 1.f);
//...
   mAudioTypeVolume[type] = volume;

#1
02/14/2002 (10:05 am)
I seem to have lost my wrapping text here, but the point is that the console fun returns an S32, but the value it is returning is an F32 clamped to between 0 and 1. So something is not right.