开发者

In a class is a variable not accessable from other thread

开发者 https://www.devze.com 2023-04-08 16:32 出处:网络
I have an byte array declared in the header of the class. When I want to access it in the audio event Methode of the microphone the array is开发者_如何学JAVA NOTHING and not available in this class on

I have an byte array declared in the header of the class. When I want to access it in the audio event Methode of the microphone the array is开发者_如何学JAVA NOTHING and not available in this class on this point.

Any idea how to declare the array to get access in the other thread?

Regards

Private Class Test1234
Private BufferData(1023) As Byte

Private Sub microphone_BufferReady(sender As Object, e As System.EventArgs) Handles microphone.BufferReady
        ' Retrieve audio data
        microphone.GetData(Me.BufferData)'<-- Is NOTHING
End Sub
End Class

I am asking why Me.BufferData is nothing when I am in the microphone Event. Because it is pre-set on initilizing routine with a size of 1024 Bytes


Your BufferData is never initialized, just declared

BufferData As New Byte(1023)

0

精彩评论

暂无评论...
验证码 换一张
取 消