UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
rada_encode.h
Go to the documentation of this file.
1// Copyright Epic Games Tools, LLC. All Rights Reserved.
2#pragma once
3#include <stdint.h>
4
5#define RADA_LIBRARY_VERSION 1
6
7#ifndef RR_STRING_JOIN3
8#define RR_STRING_JOIN3(arg1, arg2, arg3) RR_STRING_JOIN_DELAY3(arg1, arg2, arg3)
9#define RR_STRING_JOIN_DELAY3(arg1, arg2, arg3) RR_STRING_JOIN_IMMEDIATE3(arg1, arg2, arg3)
10#define RR_STRING_JOIN_IMMEDIATE3(arg1, arg2, arg3) arg1 ## arg2 ## arg3
11#endif
12
13#ifndef RR_STRING_JOIN
14#define RR_STRING_JOIN(arg1, arg2) RR_STRING_JOIN_DELAY(arg1, arg2)
15#define RR_STRING_JOIN_DELAY(arg1, arg2) RR_STRING_JOIN_IMMEDIATE(arg1, arg2)
16#define RR_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2
17#endif
18
19
20#ifdef RADA_WRAP
21#define RADA_NAME(name) RR_STRING_JOIN3(RADA_WRAP, name##_, RADA_LIBRARY_VERSION )
22#else
23#error RADA_WRAP must be defined (MIRA or UERA)
24#endif
25
26
27typedef void* RadACompressAllocFnType(uintptr_t ByteCount);
28typedef void RadACompressFreeFnType(void* Ptr);
29
30#define RADA_COMPRESS_SUCCESS 0
31#define RADA_COMPRESS_ERROR_CHANS 1
32#define RADA_COMPRESS_ERROR_SAMPLES 2
33#define RADA_COMPRESS_ERROR_RATE 3
34#define RADA_COMPRESS_ERROR_QUALITY 4
35#define RADA_COMPRESS_ERROR_ALLOCATORS 5
36#define RADA_COMPRESS_ERROR_OUTPUT 6
37#define RADA_COMPRESS_ERROR_SEEKTABLE 7
38#define RADA_COMPRESS_ERROR_SIZE 8
39#define RADA_COMPRESS_ERROR_ENCODER 9
40#define RADA_COMPRESS_ERROR_ALLOCATION 10
41
42#define RadAErrorString RADA_NAME(RadAErrorString)
43#define EncodeRadAFile RADA_NAME(EncodeRadAFile)
44#define RadAGetBuildVersion RADA_NAME(RadAGetBuildVersion)
45
46// The build version of the rad audio library in it's entirety. This is distinct from the
47// compilation version that determine linker compatibility. This is incremented each time
48// the library is released
49#define RADA_BUILD_VERSION (0x00000001U)
50
51// Return the build version that the library was compiled with. This should match RADA_BUILD_VERSION!
53
54// Pass in one of the above values to get a human readable error, returned
55// as a utf8 string.
57
58static const uint32_t RADA_MAX_CHANS = 32;
59static const uint32_t RADA_VALID_RATES[] = {48000, 44100, 32000, 24000};
60
61//
62// Create a "RADA" file, which is a container format for blocks of rad audio encoded
63// sound data.
64//
65// Compresses up to 32 channels. Only RADA_VALID_RATES sample rates are allowed.
66//
67// Quality is between 1 and 9, with 9 being high quality. 5 is a sane default.
68// PcmData should be interleaved 16 bit pcm data.
69// PcmDataLen is in bytes.
70// OutData will be filled with a buffer allocated by MemAlloc that contains the file data.
71// SeekTableMaxEntries is used to cap the amount of disk space used on the seek table.
72// If GenerateSeekTable is set, this should be at least 1k or so to be useful.
73// if InSeamlessLooping is set, the encoder provides the ends of the stream to the encoder for
74// use in padding the mDCT. This coerces the math to provide outputs that sync across the file endpoints.
75#if defined(__RADINDLL__) && defined(_MSC_VER) // we have a windows dll target.
77#endif
79 void* InPcmData,
89 void** OutData,
91
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
__declspec(dllimport) int __stdcall IsDebuggerPresent()
#define RadAErrorString
Definition rada_encode.h:42
#define EncodeRadAFile
Definition rada_encode.h:43
void * RadACompressAllocFnType(uintptr_t ByteCount)
Definition rada_encode.h:27
void RadACompressFreeFnType(void *Ptr)
Definition rada_encode.h:28
#define RadAGetBuildVersion
Definition rada_encode.h:44