Sub Wave_Capture(Data() As Byte,SamplingRate As Int)
'Log("Wav " & Data.Length)
'Log("Wav data: " & Data(1))
'Activity.Color=Colors.Transparent
xinterval=Activity.Width/Data.Length*1dip
yinterval=Activity.Height/128*1dip
xoffset=(Activity.Width-(xinterval*Data.Length))/2
'Erase canvas
cv.DrawRect( recht1,Colors.black,True,5dip) 'True draws a filled rectangle
For i=1 To Data.Length-1
'Draw new data
'cv.DrawLine((xinterval*i)+xoffset,50%y, xinterval*i,50%y+(i*Data(i)), Colors.Blue,1dip)
cv.DrawPoint((xinterval*i)+xoffset,50%y+Data(i),Colors.white)
Next
Activity.Invalidate
'Log("Wave capture")
'Log("Sampling Rate: " & SamplingRate) 44100
End Sub