async fn play_media_volume_sound(volume: Option<f32>, common_earcons_params: CommonEarconsParams) {
    let sound_player_connection_clone = common_earcons_params.sound_player_connection.clone();
    let sound_player_connection = sound_player_connection_clone.lock().await;
    let priority_stream_playing = common_earcons_params.priority_stream_playing;
    let sound_player_added_files = common_earcons_params.sound_player_added_files;

    if let (Some(sound_player_proxy), Some(volume_level)) =
        (sound_player_connection.as_ref(), volume)
    {
        if priority_stream_playing.load(Ordering::SeqCst) {
            fx_log_info!("Detected a stream already playing, not playing earcons sound");
            return;
        }

        if volume_level >= 1.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_MAX_FILE_PATH,
                0,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        } else if volume_level > 0.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_CHANGED_FILE_PATH,
                1,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        }
    }
}
/// Play the earcons sound given the changed volume streams.
///
/// The parameters are packaged together. See [VolumeChangeParams].
Play the earcons sound given the changed volume streams.
The parameters are packaged together.
Play the earcons sound given the changed volume streams . The parameters are packaged together .
async fn play_media_volume_sound(volume: Option<f32>, common_earcons_params: CommonEarconsParams) {
    let sound_player_connection_clone = common_earcons_params.sound_player_connection.clone();
    let sound_player_connection = sound_player_connection_clone.lock().await;
    let priority_stream_playing = common_earcons_params.priority_stream_playing;
    let sound_player_added_files = common_earcons_params.sound_player_added_files;
    if let (Some(sound_player_proxy), Some(volume_level)) =
        (sound_player_connection.as_ref(), volume)
    {
        if priority_stream_playing.load(Ordering::SeqCst) {
            fx_log_info!("Detected a stream already playing, not playing earcons sound");
            return;
        }
        if volume_level >= 1.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_MAX_FILE_PATH,
                0,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        } else if volume_level > 0.0 {
            play_sound(
                &sound_player_proxy,
                VOLUME_CHANGED_FILE_PATH,
                1,
                sound_player_added_files.clone(),
            )
            .await
            .ok();
        }
    }
}
async fn play_media_volume_sound ( volume : Option < f32 > , common_earcons_params : CommonEarconsParams ) { let sound_player_connection_clone = common_earcons_params . sound_player_connection . clone ( ) ; let sound_player_connection = sound_player_connection_clone . lock ( ) . await ; let priority_stream_playing = common_earcons_params . priority_stream_playing ; let sound_player_added_files = common_earcons_params . sound_player_added_files ; if let ( Some ( sound_player_proxy ) , Some ( volume_level ) ) = ( sound_player_connection . as_ref ( ) , volume ) { if priority_stream_playing . load ( Ordering :: SeqCst ) { fx_log_info ! ( " " ) ; return ; } if volume_level >= 1.0 { play_sound ( & sound_player_proxy , VOLUME_MAX_FILE_PATH , 0 , sound_player_added_files . clone ( ) , ) . await . ok ( ) ; } else if volume_level > 0.0 { play_sound ( & sound_player_proxy , VOLUME_CHANGED_FILE_PATH , 1 , sound_player_added_files . clone ( ) , ) . await . ok ( ) ; } } }
Play the earcons sound given the changed volume streams.
Play the earcons sound given the changed volume streams .
volume
Option<f32>
common_earcons_params
CommonEarconsParams
volume
Option<f32>
common_earcons_params
CommonEarconsParams