UpdateAudioOutput (Unreal Engine)

- Declaration

static void UpdateAudioOutput(FCavrnusOutputDevice Device);

- Description

Sets which microphone the user wishes to use. Note that the FCavrnusOutputDevice provided to this function can only be acquired by calling FetchAudioOutputs to search for available microphones.

NOTE: This only affects the Cavrnus voice chat, not your application’s other sounds.

- Blueprint Sample

Sample is taken from WBP_AudioVideoWidget.uasset in the Plugin. AudioOutputDeviceResponse is a Blueprint array of FCavrnusOutputDevice instances that was provided earlier via Fetch Audio Outputs.

UpdateAudioOutput.png
WBP_AudioVideoWidget

- Code Sample

#include "CavrnusFunctionLibrary.h" #include "Types/CavrnusOutputDevice.h" void UClassName::OnAudioOutputDeviceSelected(const FString& DeviceId) { // Member is TMap<FString, FCavrnusOutputDevice> AudioOutputDeviceList FCavrnusOutputDevice* OutputDevice = AudioOutputDeviceList.Find(DeviceId); if (OutputDevice) { UCavrnusFunctionLibrary::UpdateAudioOutput(*OutputDevice); } else { UE_LOG(LogTemp, Warning, TEXT("Selected Audio Output Device not found: %s"), *DeviceId); } }