Author Topic: Item sound volume not tapering with distance.  (Read 571 times)

Hi all,
I've ran into a problem with audio. As you move farther away from a player using the item, the sounds do not fade away, but instead cut off when they reach the maximum range determined by their description.
I've tried looking into the default weapons whose sounds do work, but I haven't found the problem with my code.

I'm creating the sound datablocks as follows:
Code: [Select]
datablock AudioProfile(IWrenchStartSound)
{
  filename = "./IWrench/impactWrenchStart.wav";
  description = AudioClose3d;
  preload = true;
};

datablock AudioProfile(IWrenchFireSound)
{
  filename = "./IWrench/impactWrenchFire.wav";
  description = AudioClose3d;
  preload = true;
};

// and so forth

and am using them in the state system of my image like so:

Code: [Select]

datablock ShapeBaseImageData(ImpactWrenchImage)
{
  shapeFile = "./IWrench/impact_wrench.dts";
  emap = true;
 
  mountPoint = 0;
  offset = "0 0 0";
 
  correctMuzzleVector = false;
  className = "WeaponImage";
 
  item = ImpactWrenchItem;
  ammo = " ";
  projectile = "";
  projectileType = "";
 
  melee = true;
  doRetraction = false;
  armReady = true;
 
  showBricks = false;
 
  stateName[0]                     = "Activate";
  stateTimeoutValue[0]             = 0.0;
  stateTransitionOnTimeout[0]      = "Ready";

  stateName[1]                     = "Ready";
  stateTransitionOnTriggerDown[1]  = "PreFire";
  stateAllowImageChange[1]         = true;
 
  stateName[2] = "PreFire";
  stateSound[2] = IWrenchStartSound;
  stateTransitionOnTimeout[2] = "Fire";
  stateTimeoutValue[2] = 0.1;
  stateAllowImageChange[2] = false;
 
  stateName[3] = "Fire";
  stateScript[3] = "onFire";
  stateTransitionOnTimeout[3] = "Reload";
  stateTimeoutValue[3] = 0.05;
  stateFire[3] = true;
  stateSound[3] = IWrenchFireSound;
  stateAllowImageChange[3] = false;
  stateWaitForTimeout[3] = true;
 
 
  stateName[4] = "Reload";
  //stateSound[4] = IWrenchStopSound;
  stateTransitionOnTriggerDown[4] = "Fire";
  stateTransitionOnTriggerUp[4] = "PostFire";
 
  stateName[5] = "PostFire";
  stateSound[5] = IWrenchStopSound;
  stateTransitionOnTimeout[5] = "Ready";
  stateAllowImageChange[5] = false;
  stateTimeoutValue[5] = 0.1;
};
If more code is needed, I'll edit it in. Pretty sure it has to do with my item images.

This happens with my other items that I've made recently too, so there must be an error somewhere in my workflow. Any help is super appreciated :P

(a side note, the files are mono-channel .wav's exported from Audacity, if it matters.)

sounds can be stereo and need to be if you want falloff I think. check before quoting me on that though.

only music absolutely must be mono.

Thanks, no dice though :\
Converted one item's set of sounds from mono to stereo and the issue is still there.
Maybe it has to do with the .wav's I'm exporting (32-bit float, 44100Hz). I don't remember torque ever being this picky about sound files though.

ninja edit: the gun's fire sound is (mono, 32-bit float, 22050Hz), I'll try those settings
EDIT2: sure enough, that was the problem. the sample/bit (can never remember) rate needs to be 22050Hz.

EDIT3: 3x edit combo, that wasn't the true solution. some sounds are still broken after the change. this is really strange.

FINAL EDIT: I was a bit too hasty with my edits earlier, but this is for sure:
making the .wav files 22050Hz and mono fixed the problem.

Locking, thanks for the help Conan.

keywords: item sounds, audioprofile, sound volume, .wav, wav, audacity
« Last Edit: January 03, 2017, 01:28:05 PM by Mr. Blockers »