JUCE: AudioData Class Reference

JUCE

Classes | Public Types | Static Public Member Functions | List of all members
AudioData Class Reference
juce_audio_basics » buffers

This class a container which holds all the classes pertaining to the AudioData::Pointer audio sample format class. More...

`#include <juce_AudioDataConverters.h>`

## Classes
class | Converter
| A base class for objects that are used to convert between two different sample formats. More...
class | ConverterInstance
| A class that converts between two templated AudioData::Pointer types, and which implements the AudioData::Converter interface. More...
struct | Format
| A struct that contains a SampleFormat and Endianness to be used with the source and destination types when calling the interleaveSamples() and deinterleaveSamples() helpers. More...
class | Pointer
| Used as a template parameter for AudioData::Pointer. More...

## Public Types
template<typename... Format>
using | InterleavedSource = ChannelData< true, true, Format... >
| A sequence of interleaved samples used as the source for the deinterleaveSamples() method. More...
template<typename... Format>
using | InterleavedDest = ChannelData< true, false, Format... >
| A sequence of interleaved samples used as the destination for the interleaveSamples() method. More...
template<typename... Format>
using | NonInterleavedSource = ChannelData< false, true, Format... >
| A sequence of non-interleaved samples used as the source for the interleaveSamples() method. More...
template<typename... Format>
using | NonInterleavedDest = ChannelData< false, false, Format... >
| A sequence of non-interleaved samples used as the destination for the deinterleaveSamples() method. More...

## Static Public Member Functions
template<typename... SourceFormat, typename... DestFormat>
static void | interleaveSamples (NonInterleavedSource< SourceFormat... > source, InterleavedDest< DestFormat... > dest, int numSamples)
| A helper function for converting a sequence of samples from a non-interleaved source to an interleaved destination. More...
template<typename... SourceFormat, typename... DestFormat>
static void | deinterleaveSamples (InterleavedSource< SourceFormat... > source, NonInterleavedDest< DestFormat... > dest, int numSamples)
| A helper function for converting a sequence of samples from an interleaved source to a non-interleaved destination. More...

## Detailed Description

This class a container which holds all the classes pertaining to the AudioData::Pointer audio sample format class.

See also
  AudioData::Pointer.

## Member Typedef Documentation

## ◆ InterleavedSource

template<typename... Format>

using AudioData::InterleavedSource = ChannelData<true, true, Format...>

A sequence of interleaved samples used as the source for the deinterleaveSamples() method.

## ◆ InterleavedDest

template<typename... Format>

using AudioData::InterleavedDest = ChannelData<true, false, Format...>

A sequence of interleaved samples used as the destination for the interleaveSamples() method.

## ◆ NonInterleavedSource

template<typename... Format>

using AudioData::NonInterleavedSource = ChannelData<false, true, Format...>

A sequence of non-interleaved samples used as the source for the interleaveSamples() method.

## ◆ NonInterleavedDest

template<typename... Format>

using AudioData::NonInterleavedDest = ChannelData<false, false, Format...>

A sequence of non-interleaved samples used as the destination for the deinterleaveSamples() method.

## Member Function Documentation

## ◆ interleaveSamples()

template<typename... SourceFormat, typename... DestFormat>

static void AudioData::interleaveSamples | ( | NonInterleavedSource< SourceFormat... > | source,
|  | InterleavedDest< DestFormat... > | dest,
|  | int | numSamples
| ) |  |
| static

A helper function for converting a sequence of samples from a non-interleaved source to an interleaved destination.

When calling this method you need to specify the source and destination data format and endianness from the AudioData SampleFormat and Endianness types and provide the data and number of channels for each. For example, to convert a floating-point stream of big endian samples to an interleaved, native endian stream of 16-bit integer samples you would do the following:

using SourceFormat = AudioData::Format<AudioData::Float32, AudioData::BigEndian>;
using DestFormat = AudioData::Format<AudioData::Int16, AudioData::NativeEndian>;
AudioData::interleaveSamples (AudioData::NonInterleavedSource<SourceFormat> { sourceData, numSourceChannels },
AudioData::InterleavedDest<DestFormat> { destData, numDestChannels },
numSamples);
AudioData::interleaveSamples
static void interleaveSamples(NonInterleavedSource< SourceFormat... > source, InterleavedDest< DestFormat... > dest, int numSamples)
A helper function for converting a sequence of samples from a non-interleaved source to an interleave...
Definition: juce_AudioDataConverters.h:721
AudioData::InterleavedDest
ChannelData< true, false, Format... > InterleavedDest
A sequence of interleaved samples used as the destination for the interleaveSamples() method.
Definition: juce_AudioDataConverters.h:697
AudioData::NonInterleavedSource
ChannelData< false, true, Format... > NonInterleavedSource
A sequence of non-interleaved samples used as the source for the interleaveSamples() method.
Definition: juce_AudioDataConverters.h:699
AudioData::Format
A struct that contains a SampleFormat and Endianness to be used with the source and destination types...
Definition: juce_AudioDataConverters.h:652

References addBytesToPointer(), and gl::source.

## ◆ deinterleaveSamples()

template<typename... SourceFormat, typename... DestFormat>

static void AudioData::deinterleaveSamples | ( | InterleavedSource< SourceFormat... > | source,
|  | NonInterleavedDest< DestFormat... > | dest,
|  | int | numSamples
| ) |  |
| static

A helper function for converting a sequence of samples from an interleaved source to a non-interleaved destination.

When calling this method you need to specify the source and destination data format and endianness from the AudioData SampleFormat and Endianness types and provide the data and number of channels for each. For example, to convert a floating-point stream of big endian samples to an non-interleaved, native endian stream of 16-bit integer samples you would do the following:

using SourceFormat = AudioData::Format<AudioData::Float32, AudioData::BigEndian>;
using DestFormat = AudioData::Format<AudioData::Int16, AudioData::NativeEndian>;
AudioData::deinterleaveSamples (AudioData::InterleavedSource<SourceFormat> { sourceData, numSourceChannels },
AudioData::NonInterleavedDest<DestFormat> { destData, numDestChannels },
numSamples);
AudioData::NonInterleavedDest
ChannelData< false, false, Format... > NonInterleavedDest
A sequence of non-interleaved samples used as the destination for the deinterleaveSamples() method.
Definition: juce_AudioDataConverters.h:701
AudioData::deinterleaveSamples
static void deinterleaveSamples(InterleavedSource< SourceFormat... > source, NonInterleavedDest< DestFormat... > dest, int numSamples)
A helper function for converting a sequence of samples from an interleaved source to a non-interleave...
Definition: juce_AudioDataConverters.h:765
AudioData::InterleavedSource
ChannelData< true, true, Format... > InterleavedSource
A sequence of interleaved samples used as the source for the deinterleaveSamples() method.
Definition: juce_AudioDataConverters.h:695

References addBytesToPointer(), and gl::source.

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

- juce_AudioDataConverters.h