UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AudioGenerator.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "UObject/Object.h"
8
9#include "AudioGenerator.generated.h"
10
19
20typedef TFunction<void(const float * InAudio, int32 NumSamples)> FOnAudioGenerate;
21
22UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent), MinimalAPI)
23class UAudioGenerator : public UObject
24{
26
27public:
30
31 // Returns the sample rate of the generator
32 int32 GetSampleRate() const { return SampleRate; }
33
34 // Returns the number of channels of the generator
35 int32 GetNumChannels() const { return NumChannels; }
36
37 // Adds a generator delegate. Returns a handle for the generator delegate, so it can be removed.
39
40 // Removes the given audio generator delegate handle
42
43protected:
44
45 // Called by derived classes to initialize the sample rate and num channels of the generator
47
48 // Called by derived classes when new audio is generated
49 AUDIOMIXER_API void OnGeneratedAudio(const float* InAudio, int32 NumSamples);
50
51 FCriticalSection CritSect;
52 int32 SampleRate;
53 int32 NumChannels;
55};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
TFunction< void(const float *InAudio, int32 NumSamples)> FOnAudioGenerate
Definition AudioGenerator.h:20
@ INDEX_NONE
Definition CoreMiscDefines.h:150
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
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
void Init()
Definition LockFreeList.h:4
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition Object.h:95
Definition AudioGenerator.h:12
int32 Id
Definition AudioGenerator.h:13
FAudioGeneratorHandle()
Definition AudioGenerator.h:15