89 bool read (
float*
const* destChannels,
int numDestChannels,
90 int64 startSampleInSource,
int numSamplesToRead);
130 bool read (
int*
const* destChannels,
132 int64 startSampleInSource,
133 int numSamplesToRead,
134 bool fillLeftoverChannelsWithCopies);
148 int startSampleInDestBuffer,
150 int64 readerStartSample,
151 bool useReaderLeftChan,
152 bool useReaderRightChan);
170 virtual void readMaxLevels (
int64 startSample,
int64 numSamples,
190 virtual void readMaxLevels (
int64 startSample,
int64 numSamples,
191 float& lowestLeft,
float& highestLeft,
192 float& lowestRight,
float& highestRight);
217 int64 numSamplesToSearch,
218 double magnitudeRangeMinimum,
219 double magnitudeRangeMaximum,
220 int minimumConsecutiveSamples);
225 double sampleRate = 0;
228 unsigned int bitsPerSample = 0;
234 unsigned int numChannels = 0;
237 bool usesFloatingPointData =
false;
272 int startOffsetInDestBuffer,
273 int64 startSampleInFile,
280 template <
class DestSampleType,
class SourceSampleType,
class SourceEndianness>
286 template <
typename TargetType>
287 static void read (TargetType*
const* destData,
int destOffset,
int numDestChannels,
288 const void* sourceData,
int numSourceChannels,
int numSamples)
noexcept
290 for (
int i = 0; i < numDestChannels; ++i)
292 if (
void* targetChan = destData[i])
297 if (i < numSourceChannels)
310 int startOffsetInDestBuffer,
int64 startSampleInFile,
311 int& numSamples,
int64 fileLengthInSamples)
313 if (destChannels ==
nullptr)
319 const int64 samplesAvailable = fileLengthInSamples - startSampleInFile;
321 if (samplesAvailable < numSamples)
323 for (
int i = numDestChannels; --i >= 0;)
324 if (destChannels[i] !=
nullptr)
325 zeromem (destChannels[i] + startOffsetInDestBuffer, (
size_t) numSamples *
sizeof (
int));
327 numSamples = (
int) samplesAvailable;
A multi-channel buffer containing floating point audio samples.
Represents a set of audio channel types.
Used as a template parameter for AudioData::Pointer.
void clearSamples(int numSamples) const noexcept
Sets a number of samples to zero.
void convertSamples(Pointer source, int numSamples) const noexcept
Writes a stream of samples into this pointer from another pointer.
A general-purpose range object, that simply represents any linear range with a start and end point.
A container for holding a set of strings which are keyed by another string.
Type * addBytesToPointer(Type *basePointer, IntegerType bytes) noexcept
A handy function which adds a number of bytes to any type of pointer and returns the result.
long long int64
A platform-independent 64-bit integer type.
void zeromem(void *memory, size_t numBytes) noexcept
Fills a block of memory with zeros.