Skip to main content

OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback

Function OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback 

Source
pub unsafe extern "C" fn OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback(
    audioSessionManager: *mut OH_AudioSessionManager,
    callback: OH_AudioSession_CurrentOutputDeviceChangedCallback,
) -> OH_AudioCommon_Result
Available on crate features api-12 and api-20 only.
Expand description

Register the audio session device change event callback.

§Arguments

  • audioSessionManager - the [#OH_AudioSessionManager] returned by the [#OH_AudioManager_GetAudioSessionManager]

  • callback - the [#OH_AudioSession_CurrentOutputDeviceChangedCallback] which is used to receive the device change event

§Returns

  • [#AUDIOCOMMON_RESULT_SUCCESS] if execution succeeds or [#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM] if parameter validation fails or [AUDIOCOMMON_RESULT_ERROR_NO_MEMORY] No memory error or [#AUDIOCOMMON_RESULT_ERROR_SYSTEM] if system state error

Available since API-level: 20