mirror of
https://github.com/RPCS3/soundtouch.git
synced 2024-09-18 23:42:27 +02:00
Allow direct buffer access
This commit is contained in:
parent
ab71c02cf0
commit
2cf59a0d51
@ -306,6 +306,15 @@ public:
|
|||||||
virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe.
|
virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe.
|
||||||
) override;
|
) override;
|
||||||
|
|
||||||
|
/// Returns a pointer to the beginning of the output samples.
|
||||||
|
/// This function is provided for accessing the output samples directly.
|
||||||
|
/// Please be careful for not to corrupt the book-keeping!
|
||||||
|
///
|
||||||
|
/// When using this function to output samples, also remember to 'remove' the
|
||||||
|
/// output samples from the buffer by calling the
|
||||||
|
/// 'receiveSamples(numSamples)' function
|
||||||
|
SAMPLETYPE *bufBegin();
|
||||||
|
|
||||||
/// Clears all the samples in the object's output and internal processing
|
/// Clears all the samples in the object's output and internal processing
|
||||||
/// buffers.
|
/// buffers.
|
||||||
virtual void clear() override;
|
virtual void clear() override;
|
||||||
|
@ -528,6 +528,17 @@ uint SoundTouch::receiveSamples(uint maxSamples)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns a pointer to the beginning of the currently non-outputted samples.
|
||||||
|
// This function is provided for accessing the output samples directly.
|
||||||
|
// Please be careful!
|
||||||
|
//
|
||||||
|
// When using this function to output samples, also remember to 'remove' the
|
||||||
|
// outputted samples from the buffer by calling the
|
||||||
|
// 'receiveSamples(numSamples)' function
|
||||||
|
SAMPLETYPE *SoundTouch::bufBegin()
|
||||||
|
{
|
||||||
|
return pTDStretch->getOutput()->ptrBegin();
|
||||||
|
}
|
||||||
|
|
||||||
/// Get ratio between input and output audio durations, useful for calculating
|
/// Get ratio between input and output audio durations, useful for calculating
|
||||||
/// processed output duration: if you'll process a stream of N samples, then
|
/// processed output duration: if you'll process a stream of N samples, then
|
||||||
|
Loading…
Reference in New Issue
Block a user