X
xucheng
1, To fix RecordFor BUG , change code to :
m_recBufferSize = (int)(Math.Min( (int)Seconds, BufferLen ) *
m_recformat.AvgBytesPerSec);
// for ( int i = 0; i < 2; i ++ )
// {
WaveHeader hdr = GetNewRecordBuffer( m_recBufferSize );
// send the buffer to the device
CheckWaveError(Core.waveInAddBuffer(m_hWaveIn, hdr.Header,
hdr.HeaderLength));
// }
2, To fix Player BUG , change code to :
private void RefillPlayBuffers()
{
while( m_qBuffers.Count < MaxBuffers )
{
int cb = (int)(BufferLen * m_format.AvgBytesPerSec);
.......
}
m_recBufferSize = (int)(Math.Min( (int)Seconds, BufferLen ) *
m_recformat.AvgBytesPerSec);
// for ( int i = 0; i < 2; i ++ )
// {
WaveHeader hdr = GetNewRecordBuffer( m_recBufferSize );
// send the buffer to the device
CheckWaveError(Core.waveInAddBuffer(m_hWaveIn, hdr.Header,
hdr.HeaderLength));
// }
2, To fix Player BUG , change code to :
private void RefillPlayBuffers()
{
while( m_qBuffers.Count < MaxBuffers )
{
int cb = (int)(BufferLen * m_format.AvgBytesPerSec);
.......
}