public IGATAudioThreadStreamClient ( float data, int offset, bool emptyData, IGATAudioThreadStream stream ) : void | ||
data | float | |
offset | int | |
emptyData | bool | |
stream | IGATAudioThreadStream | |
return | void |
void IGATAudioThreadStreamClient.HandleAudioThreadStream( float[] data, int offset, bool emptyData, IGATAudioThreadStream stream )
{
if( _needsData == false )
return;
if( !emptyData )
{
int sourceChannels = stream.NbOfChannels; //May change!
int length = stream.BufferSizePerChannel;
if( sourceChannels == 1 )
{
System.Array.Copy ( data, offset, _data, 0, length );
}
else //deinterlace
{
int i = 0;
length *= sourceChannels;
offset += observedChannel;
while( offset < length )
{
_data[i] = data[ offset ];
offset += sourceChannels;
i++;
}
}
}
_receivedZeroData = emptyData;
_needsData = false;
_dataIsUpdated = true;
}