public void WriteStreamAsync( float[] data, int offset, int numFrames )
{
if( !_vDoWrite )
return;
int length = numFrames * _numChannels;
int appliedLength = length;
if( offset + appliedLength > data.Length )
{
throw new GATException( "Cannot write, out of range!" );
}
if( appliedLength + _nextInputOffset >= _inputBufferSize )
{
appliedLength = _inputBufferSize - _nextInputOffset;
System.Array.Copy( data, offset, _inputBuffer, _nextInputOffset, appliedLength );
offset += appliedLength;
appliedLength = length - appliedLength;
_nextInputOffset = 0;
}
System.Array.Copy( data, offset, _inputBuffer, _nextInputOffset, appliedLength );
_vReceivedFrames += numFrames;
_nextInputOffset += appliedLength;
}