UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
binka_ue_encode.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3#include <stdint.h>
4
5typedef void* BAUECompressAllocFnType(uintptr_t ByteCount);
6typedef void BAUECompressFreeFnType(void* Ptr);
7
8#define BINKA_COMPRESS_SUCCESS 0
9#define BINKA_COMPRESS_ERROR_CHANS 1
10#define BINKA_COMPRESS_ERROR_SAMPLES 2
11#define BINKA_COMPRESS_ERROR_RATE 3
12#define BINKA_COMPRESS_ERROR_QUALITY 4
13#define BINKA_COMPRESS_ERROR_ALLOCATORS 5
14#define BINKA_COMPRESS_ERROR_OUTPUT 6
15#define BINKA_COMPRESS_ERROR_SEEKTABLE 7
16#define BINKA_COMPRESS_ERROR_SIZE 8
17
18#define BINKA_MAX_CHANS_STR TEXT("16") // (8*2) MAX_STREAMS stereo
19#define BINKA_MIN_RATE_STR TEXT("2 khz")
20#define BINKA_MAX_RATE_STR TEXT("256 khz")
21
22//
23// Compresses a bink audio _file_. This is distinct from _blocks_, which is
24// what binka_ue_decode handles.
25//
26// Compresses up to 16 channels. Sample rates above 48000 technically supported however
27// it doesn't really add anything.
28// Quality is between 0-9, with 0 being high quality. Below 4 is pretty bad.
29// PcmData should be interleaved 16 bit pcm data.
30// PcmDataLen is in bytes.
31// OutData will be filled with a buffer allocated by MemAlloc that contains the
32// compressed file data.
33// SeekTableMaxEntries is used to cap the amount of disk space used on the seek table.
34// Historically this has been capped at 4k, or 8k of data. If GenerateSeekTable is set,
35// this should be at least 1k or so to be useful.
37 void* PcmData,
41 uint8_t Quality,
46 void** OutData,
48
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void * BAUECompressAllocFnType(uintptr_t ByteCount)
Definition binka_ue_encode.h:5
uint8_t UECompressBinkAudio(void *PcmData, uint32_t PcmDataLen, uint32_t PcmRate, uint8_t PcmChannels, uint8_t Quality, uint8_t GenerateSeekTable, uint16_t SeekTableMaxEntries, BAUECompressAllocFnType *MemAlloc, BAUECompressFreeFnType *MemFree, void **OutData, uint32_t *OutDataLen)
Definition binka_ue_encode.cpp:333
void BAUECompressFreeFnType(void *Ptr)
Definition binka_ue_encode.h:6