September 06, 2006

AS3 volume control voodoo

While working with the AS3 sound controls this week, I've run into a few snags.

1. Despite what the Adobe docs say, SoundTransform.volume is NOT a writeable property. You have to create a completely new SoundTransform object with your desired volume and pan settings, and then ASSIGN that SoundTransform to the desired SoundChannel.soundTransform property to get it to change. Why?

2. If I fade the volume up from zero to 1 in increments of 0.01, it stops at 0.06. If I fade in increments of 0.005, it never goes up at all. If I fade in increments of 0.0101, it fades all the way up. So it looks like you can't reliably adjust the volume by 0.01 or less. Weird.

Posted by andy at 12:13 PM | Comments (1)