OpenShot Audio Library | OpenShotAudio 0.3.2
|
#include <juce_MemoryMappedAudioFormatReader.h>
Protected Member Functions | |
MemoryMappedAudioFormatReader (const File &file, const AudioFormatReader &details, int64 dataChunkStart, int64 dataChunkLength, int bytesPerFrame) | |
int64 | sampleToFilePos (int64 sample) const noexcept |
int64 | filePosToSample (int64 filePos) const noexcept |
const void * | sampleToPointer (int64 sample) const noexcept |
template<typename SampleType , typename Endianness > | |
Range< float > | scanMinAndMaxInterleaved (int channel, int64 startSampleInFile, int64 numSamples) const noexcept |
![]() | |
AudioFormatReader (InputStream *sourceStream, const String &formatName) | |
Protected Attributes | |
File | file |
Range< int64 > | mappedSection |
std::unique_ptr< MemoryMappedFile > | map |
int64 | dataChunkStart |
int64 | dataLength |
int | bytesPerFrame |
Additional Inherited Members | |
![]() | |
double | sampleRate = 0 |
unsigned int | bitsPerSample = 0 |
int64 | lengthInSamples = 0 |
unsigned int | numChannels = 0 |
bool | usesFloatingPointData = false |
StringPairArray | metadataValues |
InputStream * | input |
![]() | |
static void | clearSamplesBeyondAvailableLength (int **destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int &numSamples, int64 fileLengthInSamples) |
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.
Definition at line 47 of file juce_MemoryMappedAudioFormatReader.h.
|
protected |
Creates an MemoryMappedAudioFormatReader object.
Note that before attempting to read any data, you must call mapEntireFile() or mapSectionOfFile() to ensure that the region you want to read has been mapped.
Definition at line 393 of file juce_AudioFormatReader.cpp.
|
inlineprotectednoexcept |
Converts a byte position in the file to a sample index.
Definition at line 96 of file juce_MemoryMappedAudioFormatReader.h.
Referenced by mapSectionOfFile().
Returns the file that is being mapped
Definition at line 62 of file juce_MemoryMappedAudioFormatReader.h.
|
inlinenoexcept |
Returns the sample range that's currently memory-mapped and available for reading.
Definition at line 71 of file juce_MemoryMappedAudioFormatReader.h.
|
inline |
Returns the number of bytes currently being mapped
Definition at line 83 of file juce_MemoryMappedAudioFormatReader.h.
|
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.
bool juce::MemoryMappedAudioFormatReader::mapEntireFile | ( | ) |
Attempts to map the entire file into memory.
Definition at line 406 of file juce_AudioFormatReader.cpp.
Attempts to map a section of the file into memory.
Definition at line 411 of file juce_AudioFormatReader.cpp.
Referenced by mapEntireFile().
|
inlineprotectednoexcept |
Converts a sample index to a byte position in the file.
Definition at line 93 of file juce_MemoryMappedAudioFormatReader.h.
Referenced by mapSectionOfFile().
|
inlineprotectednoexcept |
Converts a sample index to a pointer to the mapped file memory.
Definition at line 99 of file juce_MemoryMappedAudioFormatReader.h.
|
inlineprotectednoexcept |
Used by AudioFormatReader subclasses to scan for min/max ranges in interleaved data.
Definition at line 103 of file juce_MemoryMappedAudioFormatReader.h.
|
noexcept |
Touches the memory for the given sample, to force it to be loaded into active memory.
Definition at line 434 of file juce_AudioFormatReader.cpp.
|
protected |
Definition at line 90 of file juce_MemoryMappedAudioFormatReader.h.
|
protected |
Definition at line 89 of file juce_MemoryMappedAudioFormatReader.h.
|
protected |
Definition at line 89 of file juce_MemoryMappedAudioFormatReader.h.
|
protected |
Definition at line 86 of file juce_MemoryMappedAudioFormatReader.h.
|
protected |
Definition at line 88 of file juce_MemoryMappedAudioFormatReader.h.
|
protected |
Definition at line 87 of file juce_MemoryMappedAudioFormatReader.h.