|
| AudioSubsectionReader (AudioFormatReader *sourceReader, int64 subsectionStartSample, int64 subsectionLength, bool deleteSourceWhenDeleted) |
| Creates an AudioSubsectionReader for a given data source. More...
|
|
| ~AudioSubsectionReader () override |
| Destructor. More...
|
|
bool | readSamples (int **destSamples, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int numSamples) override |
| Subclasses must implement this method to perform the low-level read operation. More...
|
|
void | readMaxLevels (int64 startSample, int64 numSamples, Range< float > *results, int numChannelsToRead) override |
| Finds the highest and lowest sample levels from a section of the audio stream. More...
|
|
virtual | ~AudioFormatReader () |
| Destructor. More...
|
|
const String & | getFormatName () const noexcept |
| Returns a description of what type of format this is. More...
|
|
bool | read (float *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead) |
| Reads samples from the stream. More...
|
|
bool | read (int *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead, bool fillLeftoverChannelsWithCopies) |
| Reads samples from the stream. More...
|
|
void | read (AudioBuffer< float > *buffer, int startSampleInDestBuffer, int numSamples, int64 readerStartSample, bool useReaderLeftChan, bool useReaderRightChan) |
| Fills a section of an AudioBuffer from this reader. More...
|
|
virtual void | readMaxLevels (int64 startSample, int64 numSamples, float &lowestLeft, float &highestLeft, float &lowestRight, float &highestRight) |
| Finds the highest and lowest sample levels from a section of the audio stream. More...
|
|
int64 | searchForLevel (int64 startSample, int64 numSamplesToSearch, double magnitudeRangeMinimum, double magnitudeRangeMaximum, int minimumConsecutiveSamples) |
| Scans the source looking for a sample whose magnitude is in a specified range. More...
|
|
virtual AudioChannelSet | getChannelLayout () |
| Get the channel layout of the audio stream. More...
|
|
This class is used to wrap an AudioFormatReader and only read from a subsection of the file.
So if you have a reader which can read a 1000 sample file, you could wrap it in one of these to only access, e.g. samples 100 to 200, and any samples outside that will come back as 0. Accessing sample 0 from this reader will actually read the first sample from the other's subsection, which might be at a non-zero position.
- See also
- AudioFormatReader
void AudioSubsectionReader::readMaxLevels |
( |
int64 |
startSample, |
|
|
int64 |
numSamples, |
|
|
Range< float > * |
results, |
|
|
int |
numChannelsToRead |
|
) |
| |
|
overridevirtual |
Finds the highest and lowest sample levels from a section of the audio stream.
This will read a block of samples from the stream, and measure the highest and lowest sample levels from the channels in that section, returning these as normalised floating-point levels.
- Parameters
-
startSample | the offset into the audio stream to start reading from. It's ok for this to be beyond the start or end of the stream. |
numSamples | how many samples to read |
results | this array will be filled with Range values for each channel. The array must contain numChannels elements. |
numChannelsToRead | the number of channels of data to scan. This must be more than zero, but not more than the total number of channels that the reader contains |
- See also
- read
Reimplemented from AudioFormatReader.