Miles Sound System SDK 7.2a

AIL_set_sample_volume_levels

The function AIL_set_sample_volume_levels controls a sample's playback volume levels.

void AIL_set_sample_volume_levels(
  HSAMPLE S,
  F32 left_level,
  F32 right_level
);

In Parameters

S
indicates the sample whose volume is to be set.
left_level
is the left speaker volume level from 0 (minimum) to 1.0 (maximum).
right_level
is the right speaker volume level from 0 (minimum) to 1.0 (maximum).

Discussion

This volume setting is linear in amplitude - using 0.5 is equivalent to 6 dB down. Use AIL_set_sample_volume_pan to set volumes linear in loudness.

All sample volume scaling occurs at full sample precision.

When a sample handle is initialized by AIL_init_sample, the sample's volume left and right values are both 0.881.

For mono samples that will undergo 3D positioning, you should always set the left and right volume levels equal to each other. Any difference will cause the 3D positioner to favor one speaker or the other in each successive multichannel pair.

Example files that use this function: SSTEST.C


Group: Digital Audio Services
Related Functions: AIL_init_sample, AIL_sample_volume_levels, AIL_sample_volume_pan, AIL_set_sample_low_pass_cut_off, AIL_set_sample_reverb_levels, AIL_set_sample_volume_pan
Related Basic Types: F32, HSAMPLE, void
Related FAQs: How do I use multi-channel sound output in Miles?, I used an older version of Miles and now my volume and pan calls are weird - what's going on? And what's with the two types of volume functions?

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.