gavl: Audio conversion options

gavl

Topics | Typedefs | Enumerations | Functions
Audio conversion options
Audio

## Topics
| Audio conversion flags

## Typedefs
typedef struct gavl_audio_options_s | gavl_audio_options_t
| Opaque container for audio conversion options.

## Enumerations
enum | gavl_audio_dither_mode_t { GAVL_AUDIO_DITHER_NONE = 0 , GAVL_AUDIO_DITHER_AUTO = 1 , GAVL_AUDIO_DITHER_RECT = 2 , GAVL_AUDIO_DITHER_TRI = 3 , GAVL_AUDIO_DITHER_SHAPED = 4 }
| Dither mode. More...
enum | gavl_resample_mode_t { GAVL_RESAMPLE_AUTO = 0 , GAVL_RESAMPLE_ZOH = 1 , GAVL_RESAMPLE_LINEAR = 2 , GAVL_RESAMPLE_SINC_FAST = 3 , GAVL_RESAMPLE_SINC_MEDIUM = 4 , GAVL_RESAMPLE_SINC_BEST = 5 }
| Resample mode. More...

## Functions
GAVL_PUBLIC void | gavl_audio_options_set_quality (gavl_audio_options_t *opt, int quality)
| Set the quality level for the converter.
GAVL_PUBLIC int | gavl_audio_options_get_quality (const gavl_audio_options_t *opt)
| Get the quality level for a converter.
GAVL_PUBLIC void | gavl_audio_options_set_dither_mode (gavl_audio_options_t *opt, gavl_audio_dither_mode_t mode)
| Set the dither mode for the converter.
GAVL_PUBLIC gavl_audio_dither_mode_t | gavl_audio_options_get_dither_mode (const gavl_audio_options_t *opt)
| Get the dither mode for the converter.
GAVL_PUBLIC void | gavl_audio_options_set_resample_mode (gavl_audio_options_t *opt, gavl_resample_mode_t mode)
| Set the resample mode for the converter.
GAVL_PUBLIC gavl_resample_mode_t | gavl_audio_options_get_resample_mode (const gavl_audio_options_t *opt)
| Get the resample mode for the converter.
GAVL_PUBLIC void | gavl_audio_options_set_conversion_flags (gavl_audio_options_t *opt, int flags)
| Set the conversion flags.
GAVL_PUBLIC int | gavl_audio_options_get_conversion_flags (const gavl_audio_options_t *opt)
| Get the conversion flags.
GAVL_PUBLIC void | gavl_audio_options_set_defaults (gavl_audio_options_t *opt)
| Set all options to their defaults.
GAVL_PUBLIC void | gavl_audio_options_set_mix_matrix (gavl_audio_options_t *opt, const double **matrix)
| Set a user defined mix matrix.
GAVL_PUBLIC const double ** | gavl_audio_options_get_mix_matrix (const gavl_audio_options_t *opt)
| Get the mix matrix.
GAVL_PUBLIC gavl_audio_options_t * | gavl_audio_options_create (void)
| Create an options container.
GAVL_PUBLIC void | gavl_audio_options_copy (gavl_audio_options_t *dst, const gavl_audio_options_t *src)
| Copy audio options.
GAVL_PUBLIC void | gavl_audio_options_destroy (gavl_audio_options_t *opt)
| Destroy audio options.

## Detailed Description

## Typedef Documentation

## ◆ gavl_audio_options_t

typedef struct gavl_audio_options_s gavl_audio_options_t

Opaque container for audio conversion options.

You don't want to know what's inside.

## Enumeration Type Documentation

## ◆ gavl_audio_dither_mode_t

enum gavl_audio_dither_mode_t

Dither mode.

## ◆ gavl_resample_mode_t

enum gavl_resample_mode_t

Resample mode.

Enumerator
GAVL_RESAMPLE_AUTO | Set from quality
GAVL_RESAMPLE_ZOH | Zero order hold interpolator, very fast, poor quality.
GAVL_RESAMPLE_LINEAR | Linear interpolator, very fast, poor quality.
GAVL_RESAMPLE_SINC_FAST | Band limited sinc interpolation, fastest, 97dB SNR, 80% BW.
GAVL_RESAMPLE_SINC_MEDIUM | Band limited sinc interpolation, medium quality, 97dB SNR, 90% BW.
GAVL_RESAMPLE_SINC_BEST | Band limited sinc interpolation, best quality, 97dB SNR, 96% BW.

## Function Documentation

## ◆ gavl_audio_options_set_quality()

GAVL_PUBLIC void gavl_audio_options_set_quality | ( | gavl_audio_options_t * | opt,
|  | int | quality )

Set the quality level for the converter.

Parameters

  opt | Audio options
  Quality settings | Quality level (see Quality settings)

## ◆ gavl_audio_options_get_quality()

GAVL_PUBLIC int gavl_audio_options_get_quality | ( | const gavl_audio_options_t * | opt | ) |

Get the quality level for a converter.

Parameters

  opt | Audio options

Returns
  Quality level (see Quality settings)

## ◆ gavl_audio_options_set_dither_mode()

GAVL_PUBLIC void gavl_audio_options_set_dither_mode | ( | gavl_audio_options_t * | opt,
|  | gavl_audio_dither_mode_t | mode )

Set the dither mode for the converter.

Parameters

  opt | Audio options
  mode | A dither mode

## ◆ gavl_audio_options_get_dither_mode()

GAVL_PUBLIC gavl_audio_dither_mode_t gavl_audio_options_get_dither_mode | ( | const gavl_audio_options_t * | opt | ) |

Get the dither mode for the converter.

Parameters

  opt | Audio options

Returns
  The dither mode

## ◆ gavl_audio_options_set_resample_mode()

GAVL_PUBLIC void gavl_audio_options_set_resample_mode | ( | gavl_audio_options_t * | opt,
|  | gavl_resample_mode_t | mode )

Set the resample mode for the converter.

Parameters

  opt | Audio options
  mode | A resample mode

## ◆ gavl_audio_options_get_resample_mode()

GAVL_PUBLIC gavl_resample_mode_t gavl_audio_options_get_resample_mode | ( | const gavl_audio_options_t * | opt | ) |

Get the resample mode for the converter.

Parameters

  opt | Audio options

Returns
  The resample mode

## ◆ gavl_audio_options_set_conversion_flags()

GAVL_PUBLIC void gavl_audio_options_set_conversion_flags | ( | gavl_audio_options_t * | opt,
|  | int | flags )

Set the conversion flags.

Parameters

  opt | Audio options
  flags | Flags (see Audio conversion flags)

## ◆ gavl_audio_options_get_conversion_flags()

GAVL_PUBLIC int gavl_audio_options_get_conversion_flags | ( | const gavl_audio_options_t * | opt | ) |

Get the conversion flags.

Parameters

  opt | Audio options

Returns
  Flags (see Audio conversion flags)

## ◆ gavl_audio_options_set_defaults()

GAVL_PUBLIC void gavl_audio_options_set_defaults | ( | gavl_audio_options_t * | opt | ) |

Set all options to their defaults.

Parameters

  opt | Audio options

## ◆ gavl_audio_options_set_mix_matrix()

GAVL_PUBLIC void gavl_audio_options_set_mix_matrix | ( | gavl_audio_options_t * | opt,
|  | const double ** | matrix )

Set a user defined mix matrix.

Parameters

  opt | Audio options
  matrix | Mix matrix to use

The matrix consists of coefficients, where matrix[i][j] is the factor for mixing input channel j to output channel i. The matrix is not copied, so it should be valid at least until the next call to gavl_audio_converter_init.

To clear a previously defined mix matrix (restoring gavls default behaviour) pass NULL.

Since 1.1.2

## ◆ gavl_audio_options_get_mix_matrix()

GAVL_PUBLIC const double ** gavl_audio_options_get_mix_matrix | ( | const gavl_audio_options_t * | opt | ) |

Get the mix matrix.

Parameters

  opt | Audio options

Returns
  The user defined mix matrix

Since 1.1.2

## ◆ gavl_audio_options_create()

GAVL_PUBLIC gavl_audio_options_t * gavl_audio_options_create | ( | void |  | ) |

Create an options container.

Returns
  Newly allocated udio options with default values

Use this to store options, which will apply for more than one converter instance. Applying the options will be done by gavl_*_get_options() followed by gavl_audio_options_copy().

## ◆ gavl_audio_options_copy()

GAVL_PUBLIC void gavl_audio_options_copy | ( | gavl_audio_options_t * | dst,
|  | const gavl_audio_options_t * | src )

Copy audio options.

Parameters

  dst | Destination
  src | Source

## ◆ gavl_audio_options_destroy()

GAVL_PUBLIC void gavl_audio_options_destroy | ( | gavl_audio_options_t * | opt | ) |

Destroy audio options.

Parameters

  opt | Audio options