mirror of https://github.com/AxioDL/amuse.git
Audio buffering bug fix
This commit is contained in:
parent
3521d94d1c
commit
f69af0e9af
|
@ -114,7 +114,15 @@ struct VSTVoiceEngine : boo::BaseAudioVoiceEngine
|
||||||
{
|
{
|
||||||
for (size_t f=0 ; f<m_renderFrames ;)
|
for (size_t f=0 ; f<m_renderFrames ;)
|
||||||
{
|
{
|
||||||
|
if (m_curBufFrame == m_5msFrames)
|
||||||
|
{
|
||||||
|
_pumpAndMixVoices(m_5msFrames, m_interleavedBuf.data());
|
||||||
|
m_curBufFrame = 0;
|
||||||
|
}
|
||||||
|
|
||||||
size_t remRenderFrames = std::min(m_renderFrames - f, m_5msFrames - m_curBufFrame);
|
size_t remRenderFrames = std::min(m_renderFrames - f, m_5msFrames - m_curBufFrame);
|
||||||
|
if (remRenderFrames)
|
||||||
|
{
|
||||||
for (size_t i=0 ; i<2 ; ++i)
|
for (size_t i=0 ; i<2 ; ++i)
|
||||||
{
|
{
|
||||||
float* bufOut = m_outputData[i];
|
float* bufOut = m_outputData[i];
|
||||||
|
@ -123,20 +131,6 @@ struct VSTVoiceEngine : boo::BaseAudioVoiceEngine
|
||||||
}
|
}
|
||||||
m_curBufFrame += remRenderFrames;
|
m_curBufFrame += remRenderFrames;
|
||||||
f += remRenderFrames;
|
f += remRenderFrames;
|
||||||
|
|
||||||
if (m_curBufFrame == m_5msFrames)
|
|
||||||
{
|
|
||||||
_pumpAndMixVoices(m_5msFrames, m_interleavedBuf.data());
|
|
||||||
m_curBufFrame = 0;
|
|
||||||
|
|
||||||
remRenderFrames = std::min(m_renderFrames - f, m_5msFrames);
|
|
||||||
for (size_t i=0 ; i<2 ; ++i)
|
|
||||||
{
|
|
||||||
float* bufOut = m_outputData[i];
|
|
||||||
for (size_t lf=0 ; lf<remRenderFrames ; ++lf)
|
|
||||||
bufOut[f+lf] = m_interleavedBuf[lf*2+i];
|
|
||||||
}
|
|
||||||
f += remRenderFrames;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,10 +84,6 @@ inline int32_t ClampFull<int32_t>(float in)
|
||||||
template <>
|
template <>
|
||||||
inline float ClampFull<float>(float in)
|
inline float ClampFull<float>(float in)
|
||||||
{
|
{
|
||||||
if (in < -1.f)
|
|
||||||
return -1.f;
|
|
||||||
else if (in > 1.f)
|
|
||||||
return 1.f;
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue