FetchAudioOutputs (Unreal Engine)

- Declaration

static void FetchAudioOutputs(CavrnusAvailableOutputDevices OnReceiveDevices);

Delegates Options:

DECLARE_DYNAMIC_DELEGATE_OneParam(FCavrnusAvailableOutputDevices, const TArray<FCavrnusOutputDevice>&, OutputDevices);

typedef TFunction<void(const TArray<FCavrnusOutputDevice>&)> CavrnusAvailableOutputDevices;

- Description

Provides a list of available speakers. This function is basically only useful if you wished to build your own version of the default voice/video UI.

- Blueprint Sample

FetchAudioOutputs.png
Audio Video Selection Widget

- Code Sample

#include "CavrnusFunctionLibrary.h" #include "Types/CavrnusCallbackTypes.h" #include "Types/CavrnusOutputDevice.h" void UClassName::Initialize() { // Member is FCavrnusAvailableOutputDevices OutputDevicesDelegate; OutputDevicesDelegate.BindUFunction(this, GET_FUNCTION_NAME_CHECKED(UClassName, OnAudioOutputDevicesReceived)); } void UClassName::OnAudioOutputDevicesReceived(const TArray<FCavrnusOutputDevice>& OutputDevices) { // Member is TMap<FString, FCavrnusOutputDevice> AudioOutputDeviceList; AudioOutputDeviceList.Empty(OutputDevices.Num()) for (auto OutputDevice : OutputDevices) { AudioOutputDeviceList.Add(OutputDevice.DeviceId, OutputDevice); } }