in case we have invalid sizes, clear buffer to avoid a constant tone to be played all the time
This commit is contained in:
parent
0ac2421e61
commit
d5bcb0fc1a
1 changed files with 8 additions and 3 deletions
|
@ -568,11 +568,16 @@ OSStatus CSound::callbackIO ( AudioDeviceID inDevice,
|
||||||
pSound->vecsTmpAudioSndCrdStereo[i] =
|
pSound->vecsTmpAudioSndCrdStereo[i] =
|
||||||
(short) ( pInData[i] * _MAXSHORT );
|
(short) ( pInData[i] * _MAXSHORT );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// incompatible sizes, clear work buffer
|
||||||
|
pSound->vecsTmpAudioSndCrdStereo.Reset ( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
// call processing callback function
|
// call processing callback function
|
||||||
pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo );
|
pSound->ProcessCallback ( pSound->vecsTmpAudioSndCrdStereo );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check size (float32 has four bytes)
|
// check size (float32 has four bytes)
|
||||||
|
|
Loading…
Reference in a new issue