Struct rrise::settings::AkInitSettings
source · pub struct AkInitSettings {Show 20 fields
pub install_assert_hook: bool,
pub max_num_paths: AkUInt32,
pub command_queue_size: AkUInt32,
pub enable_game_sync_preparation: bool,
pub continuous_playback_look_ahead: AkUInt32,
pub num_samples_per_frame: AkUInt32,
pub monitor_queue_pool_size: AkUInt32,
pub settings_main_output: AkOutputSettings,
pub max_hardware_timeout_ms: AkUInt32,
pub use_sound_bank_mgr_thread: bool,
pub use_lengine_thread: bool,
pub bgm_callback: Option<unsafe extern "C" fn(in_bBackgroundMusicMuted: bool, in_pCookie: *mut c_void) -> AKRESULT>,
pub bgm_callback_cookie: AtomicPtr<c_void>,
pub floor_plane: c_int,
pub game_units_to_meters: AkReal32,
pub task_scheduler_desc: AkTaskSchedulerDesc,
pub bank_read_buffer_size: AkUInt32,
pub debug_out_of_range_limit: AkReal32,
pub debug_out_of_range_check_enabled: bool,
pub private_stuff: AkInitSettingsPrivate,
}Expand description
Platform-independent initialization settings of the sound engine See also
Fields
install_assert_hook: boolmax_num_paths: AkUInt32Maximum number of paths for positioning
command_queue_size: AkUInt32Size of the command queue, in bytes
enable_game_sync_preparation: boolSets to true to enable AK::SoundEngine::PrepareGameSync usage.
continuous_playback_look_ahead: AkUInt32Number of quanta ahead when continuous containers should instantiate a new voice before which next sounds should start playing. This look-ahead time allows I/O to occur, and is especially useful to reduce the latency of continuous containers with trigger rate or sample-accurate transitions. Default is 1 audio quantum, also known as an audio frame. Its size is equal to AkInitSettings::num_samples_per_frame / AkPlatformInitSettings::sample_rate. For many platforms the default values - which can be overridden - are respectively 1,024 samples and 48 kHz. This gives a default 21.3 ms for an audio quantum, which is adequate if you have a RAM-based streaming device that completes transfers within 20 ms. With 1 look-ahead quantum, voices spawned by continuous containers are more likely to be ready when they are required to play, thereby improving the overall precision of sound scheduling. If your device completes transfers in 30 ms instead, you might consider increasing this value to 2 because it will grant new voices 2 audio quanta (~43 ms) to fetch data.
num_samples_per_frame: AkUInt32Number of samples per audio frame (256, 512, 1024, or 2048).
monitor_queue_pool_size: AkUInt32Size of the monitoring queue, in bytes. This parameter is not used in Release build.
settings_main_output: AkOutputSettingsMain output device settings.
max_hardware_timeout_ms: AkUInt32Amount of time to wait for HW devices to trigger an audio interrupt. If there is no interrupt after that time, the sound engine will revert to silent mode and continue operating until the HW finally comes back. Default value: 2000 (2 seconds)
use_sound_bank_mgr_thread: boolUse a separate thread for loading sound banks. Allows asynchronous operations.
use_lengine_thread: boolUse a separate thread for processing audio. If set to false, audio processing will occur in RenderAudio(). \ref goingfurther_eventmgrthread
bgm_callback: Option<unsafe extern "C" fn(in_bBackgroundMusicMuted: bool, in_pCookie: *mut c_void) -> AKRESULT>Application-defined audio source change event callback function.
Application-defined user data for the audio source change event callback function.
floor_plane: c_intFloor plane axis for 3D game object viewing.
game_units_to_meters: AkReal32The number of game units in a meter.
task_scheduler_desc: AkTaskSchedulerDescThe defined client task scheduler that AkSoundEngine will use to schedule internal tasks.
bank_read_buffer_size: AkUInt32The number of bytes read by the BankReader when new data needs to be loaded from disk during serialization. Increasing this trades memory usage for larger, but fewer, file-read events during bank loading.
debug_out_of_range_limit: AkReal32Debug setting: Only used when debug_out_of_range_check_enabled is true. This defines the maximum values samples can have. Normal audio must be contained within +1/-1. This limit should be set higher to allow temporary or short excursions out of range. Default is 16.
debug_out_of_range_check_enabled: boolDebug setting: Enable checks for out-of-range (and NAN) floats in the processing code. This incurs a small performance hit, but can be enabled in most scenarios. Will print error messages in the log if invalid values are found at various point in the pipeline. Contact AK Support with the new error messages for more information.
private_stuff: AkInitSettingsPrivatePrivate information
Implementations
sourceimpl AkInitSettings
impl AkInitSettings
sourcepub fn with_plugin_dll_path<T: AsRef<str>>(self, path: T) -> Self
pub fn with_plugin_dll_path<T: AsRef<str>>(self, path: T) -> Self
When using DLLs for plugins, specify their path. Leave NULL if DLLs are in the same folder as the game executable.
Note that on Windows, if path has spaces, the DLLs won’t be discovered properly.