Does Audio Streamer copy the contents of the buffer you pass or does it actually just play the values out of the buffer itself?
That is correct. Only the recording data is copied.That looks like the playback is using the values in my data array, not a copy.
Sub streamer_RecordBuffer (Buffer() As Byte)
Dim Value As Double
Dim i As Int
' Do some stuff with the recorded data then reuse the buffer for output
For i = 0 To (Buffer.Length-1) Step 4
Value = 32767 * Sin(LPhase) * LGain 'left value
Buffer(i+1) = Value / 256 'high byte
Buffer(i+0) = Value Mod 256 'low byte
Value = 32767 * Sin(RPhase) * RGain ' right value
Buffer(i+3) = Value / 256 'high byte
Buffer(i+2) = Value Mod 256 'low byte
LPhase = LPhase + DLPhase 'move phase forward
RPhase = RPhase + DRPhase 'move phase forward
Next
Streamer.Write(Buffer) 'should always work
End Sub