anchor.diff:  		
   		{ Submit buffer to audio system. }
   		PWaveHeader := @WaveHeaders[ CurrentBuffer ];
  -		CheckMMError( WaveOutUnprepareHeader( WaveOutHandle, PWaveHeader, SizeOf( WAVEHDR ) ) );
  -		CheckMMError( WaveOutPrepareHeader( WaveOutHandle, PWaveHeader, SizeOf( WAVEHDR ) ) );
  -		CheckMMError( WaveOutWrite( WaveOutHandle, PWaveHeader, SizeOf( WAVEHDR ) ) );
  +		CheckMMError( WaveOutUnprepareHeader( WaveOutHandle, PWaveHeader, SizeOf( TWaveHdr ) ) );
  +		CheckMMError( WaveOutPrepareHeader( WaveOutHandle, PWaveHeader, SizeOf( TWaveHdr ) ) );
  +		CheckMMError( WaveOutWrite( WaveOutHandle, PWaveHeader, SizeOf( TWaveHdr ) ) );
   		
   		{ Next buffer. }
   		CurrentBuffer := CurrentBuffer + 1;
  
positive.code: Var MixBuffer : Array Of SmallInt;
  Var MixIndex, MixLength, LFilter, RFilter : LongInt;
  
  Procedure WaveOutProc( hdrvr: HDRVR; uMsg: UINT; dwUser: DWORD; dw1, dw2: DWORD ) StdCall;
  Begin
  	//if uMsg = WOM_OPEN then Writeln( 'Device open.' );
  	If uMsg = WOM_DONE Then
  
negative.code:     Semaphore := CreateSemaphore( Nil, NUM_BUFFERS, NUM_BUFFERS, '' );
  
  	{ Open Audio Device. }
  	Err := WaveOutOpen( @WaveOutHandle, WAVE_MAPPER, @WaveFormat, DWORD_PTR( @WaveOutProc ), 0, CALLBACK_FUNCTION );
  	CheckMMError( Err );
  
  	{ Calculate Duration. }
  