本文整理汇总了C++中SampleBuffer::data方法的典型用法代码示例。如果您正苦于以下问题:C++ SampleBuffer::data方法的具体用法?C++ SampleBuffer::data怎么用?C++ SampleBuffer::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SampleBuffer
的用法示例。
在下文中一共展示了SampleBuffer::data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: swapBuffers
void SingularSampleBuffer::swapBuffers(SampleBuffer& secondaryBuffer) {
DEBUG_ASSERT_CLASS_INVARIANT_SingularSampleBuffer;
DEBUG_ASSERT(m_primaryBuffer.size() == secondaryBuffer.size());
// SampleUtil::copy() requires that the source and destination
// memory regions are disjunct. Double-buffering is necessary
// to satisfy this precondition.
SampleUtil::copy(
secondaryBuffer.data(),
m_primaryBuffer.data(m_headOffset),
getSize());
m_primaryBuffer.swap(secondaryBuffer);
// shift offsets
m_tailOffset -= m_headOffset;
m_headOffset = 0;
DEBUG_ASSERT_CLASS_INVARIANT_SingularSampleBuffer;
}
示例2: normalizeSampleRate
void SampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr,
bool _keep_settings )
{
// do samplerate-conversion to our default-samplerate
if( _src_sr != engine::mixer()->baseSampleRate() )
{
SampleBuffer * resampled = resample( this, _src_sr,
engine::mixer()->baseSampleRate() );
MM_FREE( m_data );
m_frames = resampled->frames();
m_data = MM_ALLOC( sampleFrame, m_frames );
memcpy( m_data, resampled->data(), m_frames *
sizeof( sampleFrame ) );
delete resampled;
}
if( _keep_settings == false )
{
// update frame-variables
m_loopStartFrame = m_startFrame = 0;
m_loopEndFrame = m_endFrame = m_frames;
}
}