Windows Native Toolkit

Audio System Library

Windows audio-device enumeration, default-device, volume, mute, peak, format, and enable-state nodes.

Use this library to inspect and control Windows audio endpoints for playback and recording.

Python examples use Unreal's reflected API names through the unreal module. Getter functions with output pins are shown using the tuple return style exposed by Unreal Python.

Pure Getters

Getter nodes such as Get Default Audio Device, Get Audio Volume, Is Audio Muted, and Get Audio Peak are now pure Blueprint functions. Public error-message pins were removed; failures are logged and the node returns false when applicable.

Get Audio Devices

Returns all active audio devices for the selected input or output flow.

PinDirectionPurpose
FlowInputChoose Output or Input.
Return ValueOutputTArray<FAudioDeviceInfo> for active endpoints.

FAudioDeviceInfo fields:

  • bIsDefaultDevice
  • bIsCommunicationDevice
  • DeviceName
  • DeviceID
C++ Example
#include "AudioSystemLibrary.h"

const TArray<FAudioDeviceInfo> Devices = UAudioSystemLibrary::GetAudioDevices(EWNTAudioDeviceFlow::Output);
Python Example
import unreal

devices = unreal.AudioSystemLibrary.get_audio_devices(unreal.WNTAudioDeviceFlow.OUTPUT)

Get Default Audio Device

Returns the default Windows endpoint for the selected flow and role.

PinDirectionPurpose
FlowInputChoose Output or Input.
RoleInputChoose System Default or Communication Default.
Return ValueOutputTrue when the default device was found.
OutDeviceOutputFAudioDeviceInfo for the selected default device.
C++ Example
#include "AudioSystemLibrary.h"

FAudioDeviceInfo DefaultDevice;
const bool bFound =
    UAudioSystemLibrary::GetDefaultAudioDevice(
        EWNTAudioDeviceFlow::Output,
        EWNTAudioDeviceRole::System,
        DefaultDevice);
Python Example
import unreal

found, default_device = unreal.AudioSystemLibrary.get_default_audio_device(
    unreal.WNTAudioDeviceFlow.OUTPUT,
    unreal.WNTAudioDeviceRole.SYSTEM,
)

Set Default Audio Device

Sets the normal Windows default audio device.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
Return ValueOutputTrue when the device was set successfully.
C++ Example
#include "AudioSystemLibrary.h"

const bool bChanged = UAudioSystemLibrary::SetDefaultAudioDevice(DeviceID);
Python Example
import unreal

changed = unreal.AudioSystemLibrary.set_default_audio_device(device_id)

Set Communication Audio Device

Sets the Windows communications default audio device.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
Return ValueOutputTrue when the communications device was set successfully.
C++ Example
#include "AudioSystemLibrary.h"

const bool bChanged = UAudioSystemLibrary::SetCommunicationAudioDevice(DeviceID);
Python Example
import unreal

changed = unreal.AudioSystemLibrary.set_communication_audio_device(device_id)

Set Audio Volume

Sets endpoint volume from 0.0 to 1.0.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
VolumeInputVolume value from 0.0 to 1.0.
Return ValueOutputTrue when the volume was updated.
C++ Example
#include "AudioSystemLibrary.h"

const bool bChanged = UAudioSystemLibrary::SetAudioDeviceVolume(DeviceID, 0.5f);
Python Example
import unreal

changed = unreal.AudioSystemLibrary.set_audio_device_volume(device_id, 0.5)

Get Audio Volume

Reads endpoint volume from 0.0 to 1.0.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
Return ValueOutputTrue when the volume was read successfully.
OutVolumeOutputCurrent volume from 0.0 to 1.0.
C++ Example
#include "AudioSystemLibrary.h"

float Volume = 0.0f;
const bool bRead = UAudioSystemLibrary::GetAudioDeviceVolume(DeviceID, Volume);
Python Example
import unreal

read, volume = unreal.AudioSystemLibrary.get_audio_device_volume(device_id)

Set Audio Muted

Sets endpoint mute state.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
bMutedInputDesired mute state.
Return ValueOutputTrue when mute state was updated.
C++ Example
#include "AudioSystemLibrary.h"

const bool bChanged = UAudioSystemLibrary::SetAudioDeviceMuted(DeviceID, true);
Python Example
import unreal

changed = unreal.AudioSystemLibrary.set_audio_device_muted(device_id, True)

Is Audio Muted

Reads endpoint mute state.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
Return ValueOutputTrue when mute state was read successfully.
bMutedOutputCurrent mute state.
C++ Example
#include "AudioSystemLibrary.h"

bool bMuted = false;
const bool bRead = UAudioSystemLibrary::GetAudioDeviceMuted(DeviceID, bMuted);
Python Example
import unreal

read, muted = unreal.AudioSystemLibrary.get_audio_device_muted(device_id)

Get Audio Peak

Reads the live endpoint peak level from 0.0 to 1.0.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
Return ValueOutputTrue when the peak value was read successfully.
OutPeakValueOutputLive peak value from 0.0 to 1.0.
C++ Example
#include "AudioSystemLibrary.h"

float PeakValue = 0.0f;
const bool bRead = UAudioSystemLibrary::GetAudioDevicePeak(DeviceID, PeakValue);
Python Example
import unreal

read, peak_value = unreal.AudioSystemLibrary.get_audio_device_peak(device_id)

Get Supported Audio Device Default Formats

Returns the shared-mode formats that Windows currently accepts for a device.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
Return ValueOutputTArray<FWNTAudioDeviceFormat> accepted by the device.

FWNTAudioDeviceFormat fields:

  • FormatIndex
  • ChannelCount
  • SampleRate
  • BitsPerSample
  • Description
C++ Example
#include "AudioSystemLibrary.h"

const TArray<FWNTAudioDeviceFormat> Formats =
    UAudioSystemLibrary::GetSupportedAudioDeviceFormats(DeviceID);
Python Example
import unreal

formats = unreal.AudioSystemLibrary.get_supported_audio_device_formats(device_id)

Set Audio Device Default Format

Sets the shared-mode default format by using the FormatIndex returned by Get Supported Audio Device Default Formats.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
FormatIndexInputFormat index returned by Get Supported Audio Device Default Formats.
Return ValueOutputTrue when the format was updated successfully.
C++ Example
#include "AudioSystemLibrary.h"

const bool bChanged = UAudioSystemLibrary::SetAudioDeviceDefaultFormat(DeviceID, FormatIndex);
Python Example
import unreal

changed = unreal.AudioSystemLibrary.set_audio_device_default_format(device_id, format_index)

Set Audio Device Enabled

Enables or disables an audio endpoint.

PinDirectionPurpose
DeviceIDInputDevice ID returned by Get Audio Devices.
bEnabledInputDesired enabled state.
Return ValueOutputTrue when the device state was updated successfully.
C++ Example
#include "AudioSystemLibrary.h"

const bool bChanged = UAudioSystemLibrary::SetAudioDeviceEnabled(DeviceID, false);
Python Example
import unreal

changed = unreal.AudioSystemLibrary.set_audio_device_enabled(device_id, False)

Last updated on

On this page