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

`#include <juce_MemoryAudioSource.h>`

Inheritance diagram for juce::MemoryAudioSource:

## Public Member Functions

| MemoryAudioSource (AudioBuffer< float > &audioBuffer, bool copyMemory, bool shouldLoop=false)
void | prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
void | releaseResources () override
void | getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill) override
void | setNextReadPosition (int64 newPosition) override
int64 | getNextReadPosition () const override
int64 | getTotalLength () const override
bool | isLooping () const override
void | setLooping (bool shouldLoop) override
Public Member Functions inherited from juce::PositionableAudioSource
| ~PositionableAudioSource () override=default
Public Member Functions inherited from juce::AudioSource
virtual | ~AudioSource ()=default

## Additional Inherited Members

Protected Member Functions inherited from juce::PositionableAudioSource
| PositionableAudioSource ()=default
Protected Member Functions inherited from juce::AudioSource
| AudioSource ()=default

## Detailed Description

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

Definition at line 32 of file juce_MemoryAudioSource.h.

## Constructor & Destructor Documentation

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

Definition at line 26 of file juce_MemoryAudioSource.cpp.

## Member Function Documentation

## getNextAudioBlock()

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

override virtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

Definition at line 45 of file juce_MemoryAudioSource.cpp.

## getNextReadPosition()

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

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

Definition at line 86 of file juce_MemoryAudioSource.cpp.

## getTotalLength()

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

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

Definition at line 91 of file juce_MemoryAudioSource.cpp.

## isLooping()

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

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

Definition at line 97 of file juce_MemoryAudioSource.cpp.

## prepareToPlay()

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

override virtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

Definition at line 38 of file juce_MemoryAudioSource.cpp.

## releaseResources()

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

override virtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

Definition at line 43 of file juce_MemoryAudioSource.cpp.

## setLooping()

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

override virtual

Implementation of the PositionableAudioSource method.

Reimplemented from juce::PositionableAudioSource.

Definition at line 102 of file juce_MemoryAudioSource.cpp.

## setNextReadPosition()

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

override virtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

Definition at line 81 of file juce_MemoryAudioSource.cpp.

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

- juce_MemoryAudioSource.h
- juce_MemoryAudioSource.cpp