---
name: "opus_custom.h"
section: "3"
platform: "linux"
package: "libopus-doc"
version: "1.5.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/opus_custom.h"
---

# opus\_custom.h(3)

Opus-Custom reference implementation API.

## NAME

opus\_custom.h - Opus-Custom reference implementation API.

## SYNOPSIS

`#include 'opus_defines.h'`\

### Macros

\#define **OPUS\_CUSTOM\_EXPORT**\
 \#define **OPUS\_CUSTOM\_EXPORT\_STATIC**\

### Typedefs

typedef struct **OpusCustomEncoder** **OpusCustomEncoder**\
 Contains the state of an encoder.  typedef struct **OpusCustomDecoder** **OpusCustomDecoder**\
 State of the decoder.  typedef struct **OpusCustomMode** **OpusCustomMode**\
 The mode contains all the information necessary to create an encoder.

### Functions

**OpusCustomMode** \* **opus\_custom\_mode\_create** (**opus\_int32** Fs, int frame\_size, int \*error)\
 Creates a new mode struct.  void **opus\_custom\_mode\_destroy** (**OpusCustomMode** \*mode)\
 Destroys a mode struct.  int **opus\_custom\_encoder\_get\_size** (const **OpusCustomMode** \*mode, int channels)\
 Gets the size of an OpusCustomEncoder structure.  **OpusCustomEncoder** \* **opus\_custom\_encoder\_create** (const **OpusCustomMode** \*mode, int channels, int \*error)\
 Creates a new encoder state.  void **opus\_custom\_encoder\_destroy** (**OpusCustomEncoder** \*st)\
 Destroys an encoder state.  int **opus\_custom\_encode\_float** (**OpusCustomEncoder** \*st, const float \*pcm, int frame\_size, unsigned char \*compressed, int maxCompressedBytes)\
 Encodes a frame of audio.  int **opus\_custom\_encode** (**OpusCustomEncoder** \*st, const **opus\_int16** \*pcm, int frame\_size, unsigned char \*compressed, int maxCompressedBytes)\
 Encodes a frame of audio.  int **opus\_custom\_encoder\_ctl** (**OpusCustomEncoder** \*OPUS\_RESTRICT st, int request,...)\
 Perform a CTL function on an Opus custom encoder.  int **opus\_custom\_decoder\_get\_size** (const **OpusCustomMode** \*mode, int channels)\
 Gets the size of an OpusCustomDecoder structure.  int **opus\_custom\_decoder\_init** (**OpusCustomDecoder** \*st, const **OpusCustomMode** \*mode, int channels)\
 Initializes a previously allocated decoder state The memory pointed to by st must be the size returned by opus\_custom\_decoder\_get\_size.  **OpusCustomDecoder** \* **opus\_custom\_decoder\_create** (const **OpusCustomMode** \*mode, int channels, int \*error)\
 Creates a new decoder state.  void **opus\_custom\_decoder\_destroy** (**OpusCustomDecoder** \*st)\
 Destroys a decoder state.  int **opus\_custom\_decode\_float** (**OpusCustomDecoder** \*st, const unsigned char \*data, int len, float \*pcm, int frame\_size)\
 Decode an opus custom frame with floating point output.  int **opus\_custom\_decode** (**OpusCustomDecoder** \*st, const unsigned char \*data, int len, **opus\_int16** \*pcm, int frame\_size)\
 Decode an opus custom frame.  int **opus\_custom\_decoder\_ctl** (**OpusCustomDecoder** \*OPUS\_RESTRICT st, int request,...)\
 Perform a CTL function on an Opus custom decoder.

## Detailed Description

Opus-Custom reference implementation API.

## Macro Definition Documentation

### #define OPUS\_CUSTOM\_EXPORT

### #define OPUS\_CUSTOM\_EXPORT\_STATIC

## Author

Generated automatically by Doxygen for Opus from the source code.
