Loading...
Searching...
No Matches
juce::AudioFormatWriterOptions Class Referencefinal

## Detailed Description

Options that affect the output data format produced by an AudioFormatWriter.

Format specific writers may ignore some of these options.

See also
  AudioFormat::createWriterFor(), AudioFormatWriter

The documentation for this class was generated from the following file:

- juce_audio_formats/format/juce_AudioFormatWriterOptions.h

## Public Types

enum class | SampleFormat { automatic , integral , floatingPoint }
| Used to provide a hint to the AudioFormatWriter for the output sample format. More...

## Public Member Functions

AudioFormatWriterOptions | withSampleFormat (SampleFormat x) const
| Returns a copy of these options with the specified sample format.
AudioFormatWriterOptions | withSampleRate (double x) const
| Returns a copy of these options with the specified sample rate.
AudioFormatWriterOptions | withChannelLayout (const AudioChannelSet &x) const
| Returns a copy of these options with the specified channel set.
AudioFormatWriterOptions | withNumChannels (int x) const
| Returns a copy of these options with the specified number of channels.
AudioFormatWriterOptions | withBitsPerSample (int x) const
| Returns a copy of these options with the specified bit size per sample.
AudioFormatWriterOptions | withMetadataValues (const std::unordered_map< String, String > &x) const
| Returns a copy of these options with the specified metadata container.
AudioFormatWriterOptions | withMetadata (const String &key, const String &value) const
| Returns a copy of these options with the specified metadata added.
AudioFormatWriterOptions | withQualityOptionIndex (int x) const
| Returns a copy of these options with the specified quality option index.
auto | getSampleRate () const
auto | getChannelLayout () const
auto | getNumChannels () const
auto | getBitsPerSample () const
auto | getMetadataValues () const
auto | getQualityOptionIndex () const
auto | getSampleFormat () const

## Member Enums

## SampleFormat

enum class juce::AudioFormatWriterOptions::SampleFormat

strong

Used to provide a hint to the AudioFormatWriter for the output sample format.

Use automatic for the old behaviour. The values integral and floatingPoint can be used with the WavAudioFormat when using a bit depth of 32. Other formats are not affected by this setting.

Enumerator
automatic | Lets the writer decide the format based on the other parameter values.
integral | Integral format, e.g. PCM in case of the WavAudioFormat.
floatingPoint | IEEE floating point format.

## Member Functions

## withSampleFormat()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withSampleFormat | ( | SampleFormat | x | ) | const

inline nodiscard

Returns a copy of these options with the specified sample format.

See also
  SampleFormat

References juce::withMember(), and x.

## withSampleRate()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withSampleRate | ( | double | x | ) | const

inline nodiscard

Returns a copy of these options with the specified sample rate.

This specifies the sample rate for the file, which must be one of the ones returned by AudioFormat::getPossibleSampleRates().

References juce::withMember(), and x.

## withChannelLayout()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withChannelLayout | ( | const AudioChannelSet & | x | ) | const

inline nodiscard

Returns a copy of these options with the specified channel set.

Setting this option will supersede the value passed into withNumChannels().

You should prefer to use withChannelLayout(), if specifying an AudioChannelSet is applicable, and withNumChannels() otherwise.

References juce::withMember(), and x.

## withNumChannels()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withNumChannels | ( | int | x | ) | const

inline nodiscard

Returns a copy of these options with the specified number of channels.

This is meant as a fallback for specifying the channel layout. Setting this option will have no effect if the channel layout is specified.

See also
  withChannelLayout()

References juce::withMember(), and x.

## withBitsPerSample()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withBitsPerSample | ( | int | x | ) | const

inline nodiscard

Returns a copy of these options with the specified bit size per sample.

This must be one of the values returned by AudioFormat::getPossibleBitDepths().

References juce::withMember(), and x.

## withMetadataValues()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withMetadataValues | ( | const std::unordered_map< String, String > & | x | ) | const

inline nodiscard

Returns a copy of these options with the specified metadata container.

As an alternative to this function, you can specify the key-value pairs one-by-one using the withMetadata function.

Subsequent calls of this function overwrites all previously added metadata.

This parameter is a set of metadata values that the writer should try to write to the stream. Exactly what these are depends on the format, and the subclass doesn't actually have to do anything with them if it doesn't want to. Have a look at the specific format implementation classes to see possible values that can be used.

References juce::withMember(), and x.

## withMetadata()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withMetadata | ( | const String & | key,
|  | const String & | value ) const

inline nodiscard

Returns a copy of these options with the specified metadata added.

Subsequent calls of this function adds new metadata values, while also preserving the previously added ones.

Here you can specify metadata values that the writer should try to write to the stream. Exactly what these are depends on the format, and the subclass doesn't actually have to do anything with them if it doesn't want to. Have a look at the specific format implementation classes to see possible values that can be used.

## withQualityOptionIndex()

AudioFormatWriterOptions juce::AudioFormatWriterOptions::withQualityOptionIndex | ( | int | x | ) | const

inline nodiscard

Returns a copy of these options with the specified quality option index.

The index of one of the items returned by the AudioFormat::getQualityOptions() method.

References juce::withMember(), and x.

## getSampleRate()

auto juce::AudioFormatWriterOptions::getSampleRate | ( |  | ) | const

inline nodiscard

See also
  withSampleRate()

## getChannelLayout()

auto juce::AudioFormatWriterOptions::getChannelLayout | ( |  | ) | const

inline nodiscard

See also
  withChannelLayout()

## getNumChannels()

auto juce::AudioFormatWriterOptions::getNumChannels | ( |  | ) | const

inline nodiscard

See also
  withNumChannels()

## getBitsPerSample()

auto juce::AudioFormatWriterOptions::getBitsPerSample | ( |  | ) | const

inline nodiscard

See also
  withBitsPerSample()

## getMetadataValues()

auto juce::AudioFormatWriterOptions::getMetadataValues | ( |  | ) | const

inline nodiscard

See also
  withMetadataValues()

## getQualityOptionIndex()

auto juce::AudioFormatWriterOptions::getQualityOptionIndex | ( |  | ) | const

inline nodiscard

See also
  withQualityOptionIndex()

## getSampleFormat()

auto juce::AudioFormatWriterOptions::getSampleFormat | ( |  | ) | const

inline nodiscard

See also
  withSampleFormat()

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited