Enum bevy_rrise::sound_engine::AkCallbackInfo
pub enum AkCallbackInfo {
Default {
game_obj_id: u64,
callback_type: AkCallbackType,
},
MusicSync {
game_obj_id: u64,
playing_id: u32,
segment_info: AkSegmentInfo,
music_sync_type: AkCallbackType,
user_cue_name: String,
},
DynamicSequenceItem {
game_obj_id: u64,
playing_id: u32,
audio_node_id: u32,
},
Event {
game_obj_id: u64,
callback_type: AkCallbackType,
playing_id: u32,
event_id: u32,
},
Duration {
game_obj_id: u64,
playing_id: u32,
event_id: u32,
duration: f32,
estimated_duration: f32,
audio_node_id: u32,
media_id: u32,
streaming: bool,
},
Marker {
game_obj_id: u64,
playing_id: u32,
event_id: u32,
identifier: u32,
position: u32,
label: String,
},
Midi {
game_obj_id: u64,
playing_id: u32,
event_id: u32,
midi_event: AkMIDIEvent,
},
MusicPlaylist {
game_obj_id: u64,
playing_id: u32,
event_id: u32,
playlist_id: u32,
num_playlist_items: u32,
playlist_selection: u32,
playlist_item_done: u32,
},
SpeakerMatrixVolume {
game_obj_id: u64,
playing_id: u32,
event_id: u32,
input_config: AkChannelConfig,
output_config: AkChannelConfig,
},
}
Expand description
Callback information used for all notifications sent from Wwise.
Variants
Default
Basic information structure returned for notifications that are not handled by another variant.
MusicSync
Fields
game_obj_id: u64
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
segment_info: AkSegmentInfo
Segment information corresponding to the segment triggering this callback
music_sync_type: AkCallbackType
user_cue_name: String
Cue name. Set for notifications AkCallbackType::AK_MusicSyncUserCue. Empty if cue has no name.
Callback information structure corresponding to AkCallbackType::AK_MusicSyncEntry, AkCallbackType::AK_MusicSyncBeat, AkCallbackType::AK_MusicSyncBar, AkCallbackType::AK_MusicSyncExit, AkCallbackType::AK_MusicSyncGrid, AkCallbackType::AK_MusicSyncPoint and AkCallbackType::AK_MusicSyncUserCue.
If you need the Tempo, you can compute it using the fBeatDuration
:
Tempo (beats per minute) = 60/fBeatDuration
DynamicSequenceItem
Fields
This variant is marked as non-exhaustive
game_obj_id: u64
playing_id: u32
Playing ID of Dynamic Sequence, returned by DynamicSequence::Open()
audio_node_id: u32
Audio Node ID of finished item
Callback information structure corresponding to AkCallbackType::AK_EndOfDynamicSequenceItem.
Event
Fields
game_obj_id: u64
callback_type: AkCallbackType
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
event_id: u32
Unique ID of Event, passed to PostEvent::new()
Callback information structure corresponding to AkCallbackType::AK_EndOfEvent, AkCallbackType::AK_MusicPlayStarted and AkCallbackType::AK_Starvation.
Duration
Fields
game_obj_id: u64
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
event_id: u32
Unique ID of Event, passed to PostEvent::new()
duration: f32
Duration of the sound (unit: milliseconds)
estimated_duration: f32
Estimated duration of the sound depending on source settings such as pitch. (unit: milliseconds)
audio_node_id: u32
Audio Node ID of playing item
media_id: u32
Media ID of playing item. (corresponds to ‘ID’ attribute of ‘File’ element in SoundBank metadata file)
streaming: bool
True if source is streaming, false otherwise
Callback information structure corresponding to AkCallbackType::AK_Duration.
Marker
Fields
game_obj_id: u64
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
event_id: u32
Unique ID of Event, passed to PostEvent::new()
identifier: u32
Cue point identifier
position: u32
Position in the cue point (unit: sample frames)
label: String
Label of the marker, read from the file
Callback information structure corresponding to AkCallbackType::AK_Marker.
Midi
Fields
game_obj_id: u64
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
event_id: u32
Unique ID of Event, passed to PostEvent::new()
Callback information structure corresponding to AkCallbackType::AK_MIDIEvent.
MusicPlaylist
Fields
game_obj_id: u64
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
event_id: u32
Unique ID of Event, passed to PostEvent::new()
playlist_id: u32
ID of playlist node
num_playlist_items: u32
Number of items in playlist node (may be segments or other playlists)
playlist_selection: u32
Selection: set by sound engine
playlist_item_done: u32
Playlist node done: set by sound engine
Callback information structure corresponding to AkCallbackType::AK_MusicPlaylistSelect.
Called when a music playlist container must select its next item to play.
The members playlist_selection
and playlist_item_done
are set by the sound
engine before the callback function call. They are set to the next item
selected by the sound engine.
SpeakerMatrixVolume
Fields
This variant is marked as non-exhaustive
game_obj_id: u64
playing_id: u32
Playing ID of Event, returned by PostEvent::post()
event_id: u32
Unique ID of Event, passed to PostEvent::new()
Callback information structure corresponding to AkCallbackType::AK_SpeakerVolumeMatrix, and passed to callbacks registered in [RegisterBusVolumeCallback()] or PostEvent with AkCallbackType::AK_SpeakerVolumeMatrix.
These callbacks are called at every audio frame for every connection from an input (voice or bus) to an output bus (standard or auxiliary), at the point when an input signal is about to be mixed into a mixing bus, but just before having been scaled in accordance to volumes authored in Wwise. The volumes are passed via this structure as pointers because they can be modified in the callbacks. They are factored into two linear values ([0..1]): a common base value (pfBaseVolume), that is channel-agnostic and represents the collapsed gain of all volume changes in Wwise (sliders, actions, RTPC, attenuations, …), and a matrix of gains per input/output channel, which depends on spatialization. Use the methods of AK::SpeakerVolumes::Matrix, defined in AkCommonDefs.h, to perform operations on them. Access each input channel of the volumes matrix with AK::SpeakerVolumes::Matrix::GetChannel(), passing it the input and output channel configuration. Then, you may access each element of the output vector using the standard bracket [] operator. See AK::SpeakerVolumes for more details. It is crucial that the processing done in the callback be lightweight and non-blocking.
Trait Implementations
impl Clone for AkCallbackInfo
impl Clone for AkCallbackInfo
fn clone(&self) -> AkCallbackInfo
fn clone(&self) -> AkCallbackInfo
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations
impl RefUnwindSafe for AkCallbackInfo
impl Send for AkCallbackInfo
impl Sync for AkCallbackInfo
impl Unpin for AkCallbackInfo
impl UnwindSafe for AkCallbackInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more