Loading...
Searching...
No Matches
juce::MemoryAudioSource Class Reference

## Detailed Description

An AudioSource which takes some float audio data as an input.

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

- juce_audio_basics/sources/juce_MemoryAudioSource.h

Inheritance diagram for juce::MemoryAudioSource:

## Public Member Functions

| MemoryAudioSource (AudioBuffer< float > &audioBuffer, bool copyMemory, bool shouldLoop=false)
| Creates a MemoryAudioSource by providing an audio buffer.
void | prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
| Implementation of the AudioSource method.
void | releaseResources () override
| Implementation of the AudioSource method.
void | getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill) override
| Implementation of the AudioSource method.
void | setNextReadPosition (int64 newPosition) override
| Implementation of the PositionableAudioSource method.
int64 | getNextReadPosition () const override
| Implementation of the PositionableAudioSource method.
int64 | getTotalLength () const override
| Implementation of the PositionableAudioSource method.
bool | isLooping () const override
| Implementation of the PositionableAudioSource method.
void | setLooping (bool shouldLoop) override
| Implementation of the PositionableAudioSource method.
Public Member Functions inherited from juce::PositionableAudioSource
| ~PositionableAudioSource () override=default
| Destructor.
Public Member Functions inherited from juce::AudioSource
virtual | ~AudioSource ()=default
| Destructor.

## Additional Inherited Members

Protected Member Functions inherited from juce::PositionableAudioSource
| PositionableAudioSource ()=default
| Creates the PositionableAudioSource.
Protected Member Functions inherited from juce::AudioSource
| AudioSource ()=default
| Creates an AudioSource.

## Constructors and Destructors

## MemoryAudioSource()

juce::MemoryAudioSource::MemoryAudioSource | ( | AudioBuffer< float > & | audioBuffer,
|  | bool | copyMemory,
|  | bool | shouldLoop = false )

Creates a MemoryAudioSource by providing an audio buffer.

If copyMemory is true then the buffer will be copied into an internal buffer which will be owned by the MemoryAudioSource. If copyMemory is false, then you must ensure that the lifetime of the audio buffer is at least as long as the MemoryAudioSource.

Referenced by setLooping().

## Member Functions

## prepareToPlay()

void juce::MemoryAudioSource::prepareToPlay | ( | int | samplesPerBlockExpected,
|  | double | sampleRate )

override virtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

## releaseResources()

void juce::MemoryAudioSource::releaseResources | ( |  | ) |

override virtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

## getNextAudioBlock()

void juce::MemoryAudioSource::getNextAudioBlock | ( | const AudioSourceChannelInfo & | bufferToFill | ) |

override virtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

## setNextReadPosition()

void juce::MemoryAudioSource::setNextReadPosition | ( | int64 | newPosition | ) |

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

## getNextReadPosition()

int64 juce::MemoryAudioSource::getNextReadPosition | ( |  | ) | const

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

## getTotalLength()

int64 juce::MemoryAudioSource::getTotalLength | ( |  | ) | const

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

## isLooping()

bool juce::MemoryAudioSource::isLooping | ( |  | ) | const

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

## setLooping()

void juce::MemoryAudioSource::setLooping | ( | bool | shouldLoop | ) |

override virtual

Implementation of the PositionableAudioSource method.

Reimplemented from juce::PositionableAudioSource.

References MemoryAudioSource().

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