| Miles Sound System SDK 7.2a |
The function AIL_calculate_3D_channel_levels gives your application direct access to the Miles 3D sound-positioner function.
S32 AIL_calculate_3D_channel_levels( HDIGDRIVER dig, F32 *channel_levels, MSS_SPEAKER * *speaker_array, MSSVECTOR3D const *src_pos, MSSVECTOR3D const *src_face, MSSVECTOR3D const *src_up, F32 src_inner_angle, F32 src_outer_angle, F32 src_outer_volume, F32 src_max_dist, F32 src_min_dist, MSSVECTOR3D const *listen_pos, MSSVECTOR3D const *listen_face, MSSVECTOR3D const *listen_up, F32 rolloff_factor, MSSVECTOR3D const *doppler_velocity, F32 *doppler_shift ); |
The number of entries written to the channel_levels array (as well as the number of entries in the array whose location is written to *speaker_array). This will be the same as the n_logical_channels value returned by AIL_speaker_configuration.
This function gives you the ability to position sounds in 3D space yourself without going through the normal Miles 3D sample/listener API. Its output consists of two parallel arrays, channel_levels and speaker_array, which are suitable for use as the levels and dest_speaker_indexes inputs to the AIL_set_sample_channel_levels function. Additionally, an optional Doppler-shift factor that can be applied with AIL_set_sample_playback_rate is also returned.
You can use this function in cases where you don't want MSS to maintain its own copy of an HSAMPLE's 3D state for any reason, or when you wish to modify the results of the default 3D positioning algorithm used by the library. An example might be an application requiring multiple "listeners" on the same physical platform; e.g., a split-screen multiplayer title.
For details on sound positions, cones, and distance attenuation, refer to the AIL_set_sample_3D_position, AIL_set_sample_3D_cone, AIL_set_sample_3D_distances, and AIL_set_3D_rolloff_factor functions. For simplicity's sake, most applications should use these functions rather than calling AIL_calculate_3D_channel_levels manually.
Note that the auto_3D_wet_atten parameter in AIL_set_sample_3D_distances has no corresponding functionality when AIL_calculate_3D_channel_levels is used. If you need to scale wet-reverb attenuation based on distance while using AIL_calculate_3D_channel_levels, you'll need to perform the calculation separately and pass the result to AIL_set_sample_reverb_levels.
For more information on channel-based control functions such as this one, you can review the How do I use multi-channel sound output in Miles? FAQ.
Group:
Digital Audio Services
Related Functions:
AIL_calculate_3D_channel_levels, AIL_set_3D_rolloff_factor, AIL_set_sample_3D_cone, AIL_set_sample_3D_distances, AIL_set_sample_3D_position, AIL_set_sample_channel_levels, AIL_set_sample_playback_rate, AIL_set_sample_reverb_levels, AIL_speaker_configuration
Related Basic Types:
F32, HDIGDRIVER, MSS_SPEAKER, S32
Related Structures:
MSSVECTOR3D
Related FAQs:
How do I use multi-channel sound output in Miles?
For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.