Audio conversion options
Audio

## Modules

| Audio conversion flags

## Typedefs

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

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

## 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 | Quality level (see Quality settings)

## gavl_audio_options_get_quality()

GAVL_PUBLIC int gavl_audio_options_get_quality | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( |  | ) |

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