Loading...
Searching...
No Matches
juce::AudioSourceChannelInfo Struct Reference

## Detailed Description

Used by AudioSource::getNextAudioBlock().

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

- juce_audio_basics/sources/juce_AudioSource.h

## Public Member Functions

| AudioSourceChannelInfo ()=default
| Creates an uninitialised AudioSourceChannelInfo.
| AudioSourceChannelInfo (AudioBuffer< float > *bufferToUse, int startSampleOffset, int numSamplesToUse) noexcept
| Creates an AudioSourceChannelInfo.
| AudioSourceChannelInfo (AudioBuffer< float > &bufferToUse) noexcept
| Creates an AudioSourceChannelInfo that uses the whole of a buffer.
void | clearActiveBufferRegion () const
| Convenient method to clear the buffer if the source is not producing any data.

## Public Attributes

AudioBuffer< float > * | buffer
| The destination buffer to fill with audio data.
int | startSample
| The first sample in the buffer from which the callback is expected to write data.
int | numSamples
| The number of samples in the buffer which the callback is expected to fill with data.

## Constructors and Destructors

## AudioSourceChannelInfo() [1/3]

juce::AudioSourceChannelInfo::AudioSourceChannelInfo | ( |  | ) |

default

Creates an uninitialised AudioSourceChannelInfo.

## AudioSourceChannelInfo() [2/3]

juce::AudioSourceChannelInfo::AudioSourceChannelInfo | ( | AudioBuffer< float > * | bufferToUse,
|  | int | startSampleOffset,
|  | int | numSamplesToUse )

inline noexcept

Creates an AudioSourceChannelInfo.

References buffer, numSamples, and startSample.

## AudioSourceChannelInfo() [3/3]

juce::AudioSourceChannelInfo::AudioSourceChannelInfo | ( | AudioBuffer< float > & | bufferToUse | ) |

inline explicit noexcept

Creates an AudioSourceChannelInfo that uses the whole of a buffer.

Note that the buffer provided must not be deleted while the AudioSourceChannelInfo is still using it.

References buffer, numSamples, and startSample.

## Member Functions

## clearActiveBufferRegion()

void juce::AudioSourceChannelInfo::clearActiveBufferRegion | ( |  | ) | const

inline

Convenient method to clear the buffer if the source is not producing any data.

References buffer, numSamples, and startSample.

## Member Data Documentation

## buffer

AudioBuffer<float>* juce::AudioSourceChannelInfo::buffer

The destination buffer to fill with audio data.

When the AudioSource::getNextAudioBlock() method is called, the active section of this buffer should be filled with whatever output the source produces.

Only the samples specified by the startSample and numSamples members of this structure should be affected by the call.

The contents of the buffer when it is passed to the AudioSource::getNextAudioBlock() method can be treated as the input if the source is performing some kind of filter operation, but should be cleared if this is not the case - the clearActiveBufferRegion() is a handy way of doing this.

The number of channels in the buffer could be anything, so the AudioSource must cope with this in whatever way is appropriate for its function.

Referenced by AudioSourceChannelInfo(), AudioSourceChannelInfo(), and clearActiveBufferRegion().

## startSample

int juce::AudioSourceChannelInfo::startSample

The first sample in the buffer from which the callback is expected to write data.

Referenced by AudioSourceChannelInfo(), AudioSourceChannelInfo(), and clearActiveBufferRegion().

## numSamples

int juce::AudioSourceChannelInfo::numSamples

The number of samples in the buffer which the callback is expected to fill with data.

Referenced by AudioSourceChannelInfo(), AudioSourceChannelInfo(), and clearActiveBufferRegion().

### 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