Game Development Reference
In-Depth Information
specified in 100th of a decibel ( dB ). The valid range for this property is 0 to 10,000 .
Also, note that the maximum value of 10,000 represents the original volume of the
sound. As you can see, this means that DirectSound does not support amplification,
as is stated in their documentation.
Frequency control
This is similar to controlling the volume. You can change the frequency of the
sound by setting the BufferFlags.ControlFrequency flag and then changing
the value of the sound buffer's Frequency property. The valid range of values for
this property is 100 to 100,000 . If you want to use the original frequency of the
audio track, set this property to a value of 0 . If you wanted to double the playback
speed of your sound for example, you would need to double its frequency.
Pan control
If you set the BufferFlags.ControlPan flag on the buffer, you can change the
left/right balance of the sound by editing the sound buffer's Pan property. If you shift
it right, the sound will come out of the right speaker more than the left. The valid
range of values for this property is -10,000 to 10,000 . At -10,000 , the sound will
only come out of the left speaker, and at 10,000 it will only come out of the right
speaker. A value of 0 specifies the center, or in other words, the sound will come out
of both speakers equally.
There are, of course, more flags besides these ones too and other effects that you
can apply to your sound, but we don't have room to cover them here. These flags
are all defined in the BufferFlags enumeration.
Note
You need to set the proper buffer flags as mentioned previously, before you can
use these various controls on your sound.
Search WWH ::




Custom Search