#include <juce_MemoryMappedAudioFormatReader.h>
|
const File & | getFile () const noexcept |
|
bool | mapEntireFile () |
|
virtual bool | mapSectionOfFile (Range< int64 > samplesToMap) |
|
Range< int64 > | getMappedSection () const noexcept |
|
void | touchSample (int64 sample) const noexcept |
|
virtual void | getSample (int64 sampleIndex, float *result) const noexcept=0 |
|
size_t | getNumBytesUsed () const |
|
virtual | ~AudioFormatReader () |
|
const String & | getFormatName () const noexcept |
|
bool | read (float *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead) |
|
bool | read (int *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead, bool fillLeftoverChannelsWithCopies) |
|
void | read (AudioBuffer< float > *buffer, int startSampleInDestBuffer, int numSamples, int64 readerStartSample, bool useReaderLeftChan, bool useReaderRightChan) |
|
virtual void | readMaxLevels (int64 startSample, int64 numSamples, Range< float > *results, int numChannelsToRead) |
|
virtual void | readMaxLevels (int64 startSample, int64 numSamples, float &lowestLeft, float &highestLeft, float &lowestRight, float &highestRight) |
|
int64 | searchForLevel (int64 startSample, int64 numSamplesToSearch, double magnitudeRangeMinimum, double magnitudeRangeMaximum, int minimumConsecutiveSamples) |
|
virtual AudioChannelSet | getChannelLayout () |
|
virtual bool | readSamples (int **destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int numSamples)=0 |
|
A specialised type of AudioFormatReader that uses a MemoryMappedFile to read directly from an audio file.
This allows for incredibly fast random-access to sample data in the mapped region of the file, but not all audio formats support it - see AudioFormat::createMemoryMappedReader().
Note that before reading samples from a MemoryMappedAudioFormatReader, you must first call mapEntireFile() or mapSectionOfFile() to ensure that the region you want to read has been mapped.
- See also
- AudioFormat::createMemoryMappedReader, AudioFormatReader
Definition at line 47 of file juce_MemoryMappedAudioFormatReader.h.
◆ MemoryMappedAudioFormatReader()
juce::MemoryMappedAudioFormatReader::MemoryMappedAudioFormatReader |
( |
const File & |
file, |
|
|
const AudioFormatReader & |
details, |
|
|
int64 |
dataChunkStart, |
|
|
int64 |
dataChunkLength, |
|
|
int |
bytesPerFrame |
|
) |
| |
|
protected |
◆ filePosToSample()
int64 juce::MemoryMappedAudioFormatReader::filePosToSample |
( |
int64 |
filePos | ) |
const |
|
inlineprotectednoexcept |
◆ getFile()
const File & juce::MemoryMappedAudioFormatReader::getFile |
( |
| ) |
const |
|
inlinenoexcept |
◆ getMappedSection()
Range< int64 > juce::MemoryMappedAudioFormatReader::getMappedSection |
( |
| ) |
const |
|
inlinenoexcept |
◆ getNumBytesUsed()
size_t juce::MemoryMappedAudioFormatReader::getNumBytesUsed |
( |
| ) |
const |
|
inline |
◆ getSample()
virtual void juce::MemoryMappedAudioFormatReader::getSample |
( |
int64 |
sampleIndex, |
|
|
float * |
result |
|
) |
| const |
|
pure virtualnoexcept |
Returns the samples for all channels at a given sample position. The result array must be large enough to hold a value for each channel that this reader contains.
◆ mapEntireFile()
bool juce::MemoryMappedAudioFormatReader::mapEntireFile |
( |
| ) |
|
◆ mapSectionOfFile()
bool juce::MemoryMappedAudioFormatReader::mapSectionOfFile |
( |
Range< int64 > |
samplesToMap | ) |
|
|
virtual |
◆ sampleToFilePos()
int64 juce::MemoryMappedAudioFormatReader::sampleToFilePos |
( |
int64 |
sample | ) |
const |
|
inlineprotectednoexcept |
◆ sampleToPointer()
const void * juce::MemoryMappedAudioFormatReader::sampleToPointer |
( |
int64 |
sample | ) |
const |
|
inlineprotectednoexcept |
◆ scanMinAndMaxInterleaved()
template<typename SampleType , typename Endianness >
Range< float > juce::MemoryMappedAudioFormatReader::scanMinAndMaxInterleaved |
( |
int |
channel, |
|
|
int64 |
startSampleInFile, |
|
|
int64 |
numSamples |
|
) |
| const |
|
inlineprotectednoexcept |
◆ touchSample()
void juce::MemoryMappedAudioFormatReader::touchSample |
( |
int64 |
sample | ) |
const |
|
noexcept |
◆ bytesPerFrame
int juce::MemoryMappedAudioFormatReader::bytesPerFrame |
|
protected |
◆ dataChunkStart
int64 juce::MemoryMappedAudioFormatReader::dataChunkStart |
|
protected |
◆ dataLength
int64 juce::MemoryMappedAudioFormatReader::dataLength |
|
protected |
◆ file
File juce::MemoryMappedAudioFormatReader::file |
|
protected |
◆ map
◆ mappedSection
Range<int64> juce::MemoryMappedAudioFormatReader::mappedSection |
|
protected |
The documentation for this class was generated from the following files: