UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AudioMixerPlatformAudioLink.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "AudioMixer.h"
6#include "IAudioLinkFactory.h"
7
8namespace Audio
9{
11 {
12 public:
13
15 virtual ~FAudioMixerPlatformAudioLink() = default;
16 protected:
17
18 //~ Begin IAudioMixerPlatformInterface Interface
19 FString GetPlatformApi() const override { return TEXT("AudioLink"); }
20 bool InitializeHardware() override;
21 bool TeardownHardware() override;
22 bool IsInitialized() const override;
26 virtual bool OpenAudioStream(const FAudioMixerOpenStreamParams& Params) override;
27 bool CloseAudioStream() override;
28 bool StartAudioStream() override;
29 bool StopAudioStream() override;
31 FString GetDefaultDeviceName() override;
33 //~ End IAudioMixerPlatformInterface Interface
34
35 private:
36 void MakeDeviceInfo(int32 InNumChannels, int32 InSampleRate, const FString& InName);
37
38 void OnLinkOpenStream(const IAudioLinkSynchronizer::FOnOpenStreamParams&);
39 void OnLinkRenderBegin(const IAudioLinkSynchronizer::FOnRenderParams&);
40 void OnLinkRenderEnd(const IAudioLinkSynchronizer::FOnRenderParams&);
41
42 IAudioLinkSynchronizer* GetOrCreateSynchronizer() const;
43
44 bool bSuspended = false;
45 bool bInitialized = false;
46
47 // Atomic flag that's set by unreal, but read in callback from other host engines.
48 std::atomic<bool> bAtomicStreamRunning;
49
50 IAudioLinkFactory* Factory = nullptr;
52 FAudioPlatformDeviceInfo DeviceInfo;
53 uint32 LastBufferTickID = 0;
54 int32 FrameRemainder = 0;
55
56 FDelegateHandle OpenStreamHandle;
57 FDelegateHandle RenderBeginHandle;
58 FDelegateHandle RenderEndHandle;
59 };
60
61}
62
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AudioMixer.h:479
Definition IDelegateInstance.h:14
Definition IAudioLinkFactory.h:21
Definition IAudioLink.h:55
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53
Definition AudioMixer.h:250
Definition AudioMixer.h:152
Definition AudioMixerTypes.h:63
Definition IAudioLink.h:106