Adjustable processing interval in SoundStream #1517
Resurrection of previous PR with updated documentation. Added setter to adjust processing interval in SoundStream for low-latency streams.
This commit is contained in:
parent
0337568846
commit
95c98093e9
2 changed files with 24 additions and 3 deletions
|
@ -251,6 +251,20 @@ protected:
|
|||
////////////////////////////////////////////////////////////
|
||||
virtual Int64 onLoop();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the processing interval
|
||||
///
|
||||
/// The processing interval controls the period at which the
|
||||
/// audio buffers are filled by calls to onGetData. A smaller
|
||||
/// interval may be useful for low-latency streams. Note that
|
||||
/// the given period is only a hint and the actual period may
|
||||
/// vary. The default processing interval is 10 ms.
|
||||
///
|
||||
/// \param interval Processing interval
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void setProcessingInterval(Time interval);
|
||||
|
||||
private:
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -315,8 +329,9 @@ private:
|
|||
unsigned int m_sampleRate; //!< Frequency (samples / second)
|
||||
Uint32 m_format; //!< Format of the internal sound buffers
|
||||
bool m_loop; //!< Loop flag (true to loop, false to play once)
|
||||
Uint64 m_samplesProcessed; //!< Number of buffers processed since beginning of the stream
|
||||
Uint64 m_samplesProcessed; //!< Number of samples processed since beginning of the stream
|
||||
Int64 m_bufferSeeks[BufferCount]; //!< If buffer is an "end buffer", holds next seek position, else NoLoop. For play offset calculation.
|
||||
Time m_processingInterval; //!< Interval for checking and filling the internal sound buffers.
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue