async fn on_audio_info(&mut self, audio_info: AudioInfo) {
        let changed_streams = if audio_info.modified_counters.is_none() {
            Vec::new()
        } else {
            self.calculate_changed_streams(
                audio_info.streams,
                audio_info.modified_counters.unwrap(),
            )
        };

        let media_user_volume =
            self.get_user_volume(changed_streams.clone(), AudioStreamType::Media);
        let interruption_user_volume =
            self.get_user_volume(changed_streams, AudioStreamType::Interruption);

        if let Some(media_user_volume) = media_user_volume {
            self.on_audio_info_for_stream(media_user_volume, AudioStreamType::Media).await;
        }
        if let Some(interruption_user_volume) = interruption_user_volume {
            self.on_audio_info_for_stream(interruption_user_volume, AudioStreamType::Interruption)
                .await;
        }
    }
/// Invoked when a new `AudioInfo` is retrieved. Determines whether an
/// earcon should be played and plays sound if necessary.
Invoked when a new `AudioInfo` is retrieved. Determines whether an
earcon should be played and plays sound if necessary.
Invoked when a new ` AudioInfo ` is retrieved . Determines whether an earcon should be played and plays sound if necessary .
async fn on_audio_info(&mut self, audio_info: AudioInfo) {
        let changed_streams = if audio_info.modified_counters.is_none() {
            Vec::new()
        } else {
            self.calculate_changed_streams(
                audio_info.streams,
                audio_info.modified_counters.unwrap(),
            )
        };
        let media_user_volume =
            self.get_user_volume(changed_streams.clone(), AudioStreamType::Media);
        let interruption_user_volume =
            self.get_user_volume(changed_streams, AudioStreamType::Interruption);
        if let Some(media_user_volume) = media_user_volume {
            self.on_audio_info_for_stream(media_user_volume, AudioStreamType::Media).await;
        }
        if let Some(interruption_user_volume) = interruption_user_volume {
            self.on_audio_info_for_stream(interruption_user_volume, AudioStreamType::Interruption)
                .await;
        }
    }
async fn on_audio_info ( & mut self , audio_info : AudioInfo ) { let changed_streams = if audio_info . modified_counters . is_none ( ) { Vec :: new ( ) } else { self . calculate_changed_streams ( audio_info . streams , audio_info . modified_counters . unwrap ( ) , ) } ; let media_user_volume = self . get_user_volume ( changed_streams . clone ( ) , AudioStreamType :: Media ) ; let interruption_user_volume = self . get_user_volume ( changed_streams , AudioStreamType :: Interruption ) ; if let Some ( media_user_volume ) = media_user_volume { self . on_audio_info_for_stream ( media_user_volume , AudioStreamType :: Media ) . await ; } if let Some ( interruption_user_volume ) = interruption_user_volume { self . on_audio_info_for_stream ( interruption_user_volume , AudioStreamType :: Interruption ) . await ; } }
Invoked when a new `AudioInfo` is retrieved.
Invoked when a new ` AudioInfo ` is retrieved .
&mut self
audio_info
AudioInfo
&mut self
audio_info
AudioInfo