---
name: "SDL_DEFINE_AUDIO_FORMAT"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_DEFINE_AUDIO_FORMAT"
---

# SDL\_DEFINE\_AUDIO\_FORMAT(3)

Define an SDL\_AudioFormat value.

## NAME

SDL\_DEFINE\_AUDIO\_FORMAT - Define an  **SDL\_AudioFormat**\
  value.

## HEADER FILE

Defined in SDL3/SDL\_audio.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**#define SDL\_DEFINE\_AUDIO\_FORMAT(signed, bigendian, flt, size) .BI** *(((Uint16)(signed)***\<\<***15)***\|***((Uint16)(bigendian)***\<\<***12)***\|***((Uint16)(flt)***\<\<***8)***\|***((size)***&***SDL\_AUDIO\_MASK\_BITSIZE))*

## DESCRIPTION

SDL does not support custom audio formats, so this macro is not of much use externally, but it can be illustrative as to what the various bits of an

**SDL\_AudioFormat**\
  mean.

For example,  **SDL\_AUDIO\_S32LE**\
  looks like this:

-

  ```
  SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 32)
  ```

## RETURN VALUE

Returns a format value in the style of  **SDL\_AudioFormat** .

## THREAD SAFETY

It is safe to call this macro from any thread.

## AVAILABILITY

This macro is available since SDL 3.2.0.
