1

I am trying to make a volume control for audio calibration. We were hoping to go to a 0.1% increment for altering the volume on a SoundChannel's volume.

This is my code, and my output.

var transform:SoundTransform = _soundChannel.soundTransform;
transform.volume = 0.999;
_soundChannel.soundTransform = transform;

trace('transform ' +transform.volume); // 0.999
trace('channel ' +_soundChannel.soundTransform.volume); // 0.99

The SoundTransform Object is retaining the 3rd decimal place, but as soon as I assign it to the soundTransform property of my SoundChannel, it's reducing the specificity of my volume.

Does anyone know what could be happening here?

Eric Holmes
  • 415
  • 7
  • 21
  • .99 is a 1% increment - This is probably a limitation of flash player (just guessing), I can't see any real world situation needing volume precision in the thousands - do you actually have one or this just learning/testing? – BadFeelingAboutThis May 30 '14 at 18:03
  • It's a real use-case, unfortunately.. We are creating a tone-test application for audiologists, and this portion is to calibrate exactly what volume the system & mixer needs to be for each frequency of a tone. – Eric Holmes May 30 '14 at 18:36
  • We are able to achieve "benchmark" levels for perfect hearing as is... but it's using something ridiculously low like 7% speaker volume and 6% on the SoundTransform itself. (iOS App) – Eric Holmes May 30 '14 at 18:37
  • the thousandth increment would have just allowed us to use something like 20% system and 2.1% `SoundTransform.volume` – Eric Holmes May 30 '14 at 18:38
  • It may indeed be a limitation of flash player. This use case may be better handled via processing or openframeworks. – Patrick Gunderson May 30 '14 at 18:43
  • Yea, your best bet may be to use a native component for the setting of the actual audio. It's pretty easy in AS3/AIR to use a custom component written in object-c that could set the audio more precisely. – BadFeelingAboutThis May 30 '14 at 19:26
  • Yes, we already are also controlling the system (phone) volume as well. Just wanted to add that extra level or precision. Looks like it may not be possible. Very strange that a `SoundTransform` accepts the `.999` value, yet the `SoundChannel` does not. – Eric Holmes May 30 '14 at 19:27
  • 1
    The strangeness is probably because the value is stored as a normal number (so it can accept any valid number value), but when it goes to set the actual volume it's rounding to the nearest valid value. That's my theory anyway... – BadFeelingAboutThis May 30 '14 at 21:55
  • Great point. I think you hit the nail on the head. – Eric Holmes Jun 02 '14 at 13:13

0 Answers0