类中的变量无法从其他线程访问
我在类的标头中声明了一个字节数组。当我想在麦克风的音频事件 Methode 中访问它时,该数组什么都不是,并且在这一点上在此类中不可用。
知道如何声明数组以在其他线程中访问吗?
我问
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
为什么当我在麦克风事件中时 Me.BufferData 什么都不是。因为它是在初始化例程中预先设置的,大小为 1024 字节
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 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 BufferData 从未初始化,只是声明
BufferData As New Byte(1023)
Your BufferData is never initialized, just declared
BufferData As New Byte(1023)