---
name: "SDL_AudioCVT"
section: "3"
platform: "linux"
package: "libsdl1.2-dev"
version: "1.2.15+dfsg2-8"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_AudioCVT"
---

# SDL\_AudioCVT(3)

Audio Conversion Structure

## NAME

SDL\_AudioCVT - Audio Conversion Structure

## STRUCTURE DEFINITION

```
typedef struct{
  int needed;
  Uint16 src_format;
  Uint16 dest_format;
  double rate_incr;
  Uint8 *buf;
  int len;
  int len_cvt;
  int len_mult;
  double len_ratio;
  void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
  int filter_index;
} SDL_AudioCVT;
```

## STRUCTURE DATA

- **needed**

  Set to one if the conversion is possible

- **src\_format**

  Audio format of the source

- **dest\_format**

  Audio format of the destination

- **rate\_incr**

  Rate conversion increment

- **buf**

  Audio buffer

- **len**

  Length of the original audio buffer in bytes

- **len\_cvt**

  Length of converted audio buffer in bytes (calculated)

- **len\_mult**

  **buf** must be **len**\***len\_mult** bytes in size(calculated)

- **len\_ratio**

  Final audio size is **len**\***len\_ratio**

- **filters\[10\](..)**

  Pointers to functions needed for this conversion

- **filter\_index**

  Current conversion function

## DESCRIPTION

The **SDL\_AudioCVT** is used to convert audio data between different formats. A **SDL\_AudioCVT** structure is created with the **SDL\_BuildAudioCVT** function, while the actual conversion is done by the **SDL\_ConvertAudio** function.

Many of the fields in the **SDL\_AudioCVT** structure should be considered private and their function will not be discussed here.

- **Uint8 \*buf**

  - **int** **len**

  - **int** **len\_mult**

  - **double** **len\_ratio**

  ## SEE ALSO

**SDL\_BuildAudioCVT**, **SDL\_ConvertAudio**, **SDL\_AudioSpec**
