// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.RTCAudio { public sealed partial class RTCAudioInterface : Handle { public RTCAudioInterface() { } public RTCAudioInterface(System.IntPtr innerHandle) : base(innerHandle) { } /// /// The most recent version of the API. /// public const int AddnotifyaudiobeforerenderApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyaudiobeforesendApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyaudiodeviceschangedApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyaudioinputstateApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyaudiooutputstateApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyparticipantupdatedApiLatest = 1; /// /// The most recent version of the API /// public const int AudiobufferApiLatest = 1; /// /// The most recent version of the struct. /// public const int AudioinputdeviceinfoApiLatest = 1; /// /// The most recent version of the struct. /// public const int AudiooutputdeviceinfoApiLatest = 1; /// /// The most recent version of the API. /// public const int GetaudioinputdevicebyindexApiLatest = 1; /// /// The most recent version of the API. /// public const int GetaudioinputdevicescountApiLatest = 1; /// /// The most recent version of the API. /// public const int GetaudiooutputdevicebyindexApiLatest = 1; /// /// The most recent version of the API. /// public const int GetaudiooutputdevicescountApiLatest = 1; /// /// The most recent version of the API. /// public const int RegisterplatformaudiouserApiLatest = 1; /// /// The most recent version of the API. /// public const int SendaudioApiLatest = 1; /// /// The most recent version of the API. /// public const int SetaudioinputsettingsApiLatest = 1; /// /// The most recent version of the API. /// public const int SetaudiooutputsettingsApiLatest = 1; /// /// The most recent version of the API. /// public const int UnregisterplatformaudiouserApiLatest = 1; /// /// The most recent version of the API. /// public const int UpdatereceivingApiLatest = 1; /// /// The most recent version of the API. /// public const int UpdatesendingApiLatest = 1; /// /// Register to receive notifications with remote audio buffers before they are rendered. /// /// This gives you access to the audio data received, allowing for example the implementation of custom filters/effects. /// /// If the returned NotificationId is valid, you must call when you no longer wish to /// have your CompletionDelegate called. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when a presence change occurs /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyAudioBeforeRender(AddNotifyAudioBeforeRenderOptions options, object clientData, OnAudioBeforeRenderCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnAudioBeforeRenderCallbackInternal(OnAudioBeforeRenderCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTCAudio_AddNotifyAudioBeforeRender(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Register to receive notifications when local audio buffers are about to be encoded and sent. /// /// This gives you access to the audio data about to be sent, allowing for example the implementation of custom filters/effects. /// /// If the returned NotificationId is valid, you must call when you no longer wish to /// have your CompletionDelegate called. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when a presence change occurs /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyAudioBeforeSend(AddNotifyAudioBeforeSendOptions options, object clientData, OnAudioBeforeSendCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnAudioBeforeSendCallbackInternal(OnAudioBeforeSendCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTCAudio_AddNotifyAudioBeforeSend(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Register to receive notifications when an audio device is added or removed to the system. /// /// If the returned NotificationId is valid, you must call when you no longer wish /// to have your CompletionDelegate called. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when an audio device change occurs /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyAudioDevicesChanged(AddNotifyAudioDevicesChangedOptions options, object clientData, OnAudioDevicesChangedCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnAudioDevicesChangedCallbackInternal(OnAudioDevicesChangedCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTCAudio_AddNotifyAudioDevicesChanged(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Register to receive notifications when audio input state changed. /// /// If the returned NotificationId is valid, you must call when you no longer wish to /// have your CompletionDelegate called. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when audio input state changes /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyAudioInputState(AddNotifyAudioInputStateOptions options, object clientData, OnAudioInputStateCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnAudioInputStateCallbackInternal(OnAudioInputStateCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTCAudio_AddNotifyAudioInputState(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Register to receive notifications when audio output state changed. /// /// If the returned NotificationId is valid, you must call when you no longer wish to /// have your CompletionDelegate called. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when audio output state changes /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyAudioOutputState(AddNotifyAudioOutputStateOptions options, object clientData, OnAudioOutputStateCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnAudioOutputStateCallbackInternal(OnAudioOutputStateCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTCAudio_AddNotifyAudioOutputState(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Register to receive notifications when a room participant audio status is updated (f.e when speaking flag changes). /// /// If the returned NotificationId is valid, you must call when you no longer wish /// to have your CompletionDelegate called. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when a presence change occurs /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyParticipantUpdated(AddNotifyParticipantUpdatedOptions options, object clientData, OnParticipantUpdatedCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnParticipantUpdatedCallbackInternal(OnParticipantUpdatedCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTCAudio_AddNotifyParticipantUpdated(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Fetches an audio input device's info from then given index. The returned value should not be cached and important /// information should be copied off of the result object immediately. /// /// /// /// structure containing the index being accessed /// /// A pointer to the device information, or NULL on error. You should NOT keep hold of this pointer. /// public AudioInputDeviceInfo GetAudioInputDeviceByIndex(GetAudioInputDeviceByIndexOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_GetAudioInputDeviceByIndex(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); AudioInputDeviceInfo funcResultReturn; Helper.TryMarshalGet(funcResult, out funcResultReturn); return funcResultReturn; } /// /// Returns the number of audio input devices available in the system. /// /// The returned value should not be cached and should instead be used immediately with the /// function. /// /// /// /// structure containing the parameters for the operation /// /// The number of audio input devices /// public uint GetAudioInputDevicesCount(GetAudioInputDevicesCountOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_GetAudioInputDevicesCount(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Fetches an audio output device's info from then given index. /// /// The returned value should not be cached and important information should be copied off of the result object immediately. /// /// /// /// structure containing the index being accessed /// /// A pointer to the device information, or NULL on error. You should NOT keep hold of this pointer. /// public AudioOutputDeviceInfo GetAudioOutputDeviceByIndex(GetAudioOutputDeviceByIndexOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_GetAudioOutputDeviceByIndex(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); AudioOutputDeviceInfo funcResultReturn; Helper.TryMarshalGet(funcResult, out funcResultReturn); return funcResultReturn; } /// /// Returns the number of audio output devices available in the system. /// /// The returned value should not be cached and should instead be used immediately with the /// function. /// /// /// /// structure containing the parameters for the operation /// /// The number of audio output devices /// public uint GetAudioOutputDevicesCount(GetAudioOutputDevicesCountOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_GetAudioOutputDevicesCount(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Use this function to inform the audio system of a user. /// /// This function is only necessary for some platforms. /// /// structure containing the parameters for the operation. /// /// if the user was successfully registered, otherwise. /// public Result RegisterPlatformAudioUser(RegisterPlatformAudioUserOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_RegisterPlatformAudioUser(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Unregister a previously bound notification handler from receiving remote audio buffers before they are rendered. /// /// The Notification ID representing the registered callback public void RemoveNotifyAudioBeforeRender(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_RTCAudio_RemoveNotifyAudioBeforeRender(InnerHandle, notificationId); } /// /// Unregister a previously bound notification handler from receiving local audio buffers before they are encoded and sent. /// /// The Notification ID representing the registered callback public void RemoveNotifyAudioBeforeSend(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_RTCAudio_RemoveNotifyAudioBeforeSend(InnerHandle, notificationId); } /// /// Unregister a previously bound notification handler from receiving audio devices notifications /// /// The Notification ID representing the registered callback public void RemoveNotifyAudioDevicesChanged(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_RTCAudio_RemoveNotifyAudioDevicesChanged(InnerHandle, notificationId); } /// /// Unregister a previously bound notification handler from receiving notifications on audio input state changed. /// /// The Notification ID representing the registered callback public void RemoveNotifyAudioInputState(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_RTCAudio_RemoveNotifyAudioInputState(InnerHandle, notificationId); } /// /// Unregister a previously bound notification handler from receiving notifications on audio output state changed. /// /// The Notification ID representing the registered callback public void RemoveNotifyAudioOutputState(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_RTCAudio_RemoveNotifyAudioOutputState(InnerHandle, notificationId); } /// /// Unregister a previously bound notification handler from receiving participant updated notifications /// /// The Notification ID representing the registered callback public void RemoveNotifyParticipantUpdated(ulong notificationId) { Helper.TryRemoveCallbackByNotificationId(notificationId); Bindings.EOS_RTCAudio_RemoveNotifyParticipantUpdated(InnerHandle, notificationId); } /// /// Use this function to push a new audio buffer to be sent to the participants of a room. /// /// This should only be used if Manual Audio Input was enabled locally for the specified room. /// /// /// /// structure containing the parameters for the operation. /// /// if the buffer was successfully queued for sending /// if any of the parameters are incorrect /// if the specified room was not found /// if manual recording was not enabled when joining the room. /// public Result SendAudio(SendAudioOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_SendAudio(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Use this function to set audio input settings, such as the active input device, volume, or platform AEC. /// /// structure containing the parameters for the operation. /// /// if the setting was successful /// if any of the parameters are incorrect /// public Result SetAudioInputSettings(SetAudioInputSettingsOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_SetAudioInputSettings(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Use this function to set audio output settings, such as the active output device or volume. /// /// structure containing the parameters for the operation. /// /// if the setting was successful /// if any of the parameters are incorrect /// public Result SetAudioOutputSettings(SetAudioOutputSettingsOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_SetAudioOutputSettings(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Use this function to remove a user that was added with . /// /// structure containing the parameters for the operation. /// /// if the user was successfully unregistered, otherwise. /// public Result UnregisterPlatformAudioUser(UnregisterPlatformAudioUserOptions options) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var funcResult = Bindings.EOS_RTCAudio_UnregisterPlatformAudioUser(InnerHandle, optionsAddress); Helper.TryMarshalDispose(ref optionsAddress); return funcResult; } /// /// Use this function to tweak incoming audio options per room. /// /// @note Due to internal implementation details, this function requires that you first register to any notification for room /// /// structure containing the parameters for the operation. /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when the operation completes, either successfully or in error /// /// if the operation succeeded /// if any of the parameters are incorrect /// if either the local user or specified participant are not in the room /// public void UpdateReceiving(UpdateReceivingOptions options, object clientData, OnUpdateReceivingCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnUpdateReceivingCallbackInternal(OnUpdateReceivingCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_RTCAudio_UpdateReceiving(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } /// /// Use this function to tweak outgoing audio options per room. /// /// @note Due to internal implementation details, this function requires that you first register to any notification for room /// /// structure containing the parameters for the operation. /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when the operation completes, either successfully or in error /// /// if the operation succeeded /// if any of the parameters are incorrect /// if the local user is not in the room /// public void UpdateSending(UpdateSendingOptions options, object clientData, OnUpdateSendingCallback completionDelegate) { var optionsAddress = System.IntPtr.Zero; Helper.TryMarshalSet(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnUpdateSendingCallbackInternal(OnUpdateSendingCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_RTCAudio_UpdateSending(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal); Helper.TryMarshalDispose(ref optionsAddress); } [MonoPInvokeCallback(typeof(OnAudioBeforeRenderCallbackInternal))] internal static void OnAudioBeforeRenderCallbackInternalImplementation(System.IntPtr data) { OnAudioBeforeRenderCallback callback; AudioBeforeRenderCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnAudioBeforeSendCallbackInternal))] internal static void OnAudioBeforeSendCallbackInternalImplementation(System.IntPtr data) { OnAudioBeforeSendCallback callback; AudioBeforeSendCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnAudioDevicesChangedCallbackInternal))] internal static void OnAudioDevicesChangedCallbackInternalImplementation(System.IntPtr data) { OnAudioDevicesChangedCallback callback; AudioDevicesChangedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnAudioInputStateCallbackInternal))] internal static void OnAudioInputStateCallbackInternalImplementation(System.IntPtr data) { OnAudioInputStateCallback callback; AudioInputStateCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnAudioOutputStateCallbackInternal))] internal static void OnAudioOutputStateCallbackInternalImplementation(System.IntPtr data) { OnAudioOutputStateCallback callback; AudioOutputStateCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnParticipantUpdatedCallbackInternal))] internal static void OnParticipantUpdatedCallbackInternalImplementation(System.IntPtr data) { OnParticipantUpdatedCallback callback; ParticipantUpdatedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnUpdateReceivingCallbackInternal))] internal static void OnUpdateReceivingCallbackInternalImplementation(System.IntPtr data) { OnUpdateReceivingCallback callback; UpdateReceivingCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } [MonoPInvokeCallback(typeof(OnUpdateSendingCallbackInternal))] internal static void OnUpdateSendingCallbackInternalImplementation(System.IntPtr data) { OnUpdateSendingCallback callback; UpdateSendingCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(data, out callback, out callbackInfo)) { callback(callbackInfo); } } } }