Help

  • Thread starter Thread starter Kris Morrison
  • Start date Start date
K

Kris Morrison

Hi i need some help to convert this to vb.net form C#

short* data =(short*)buffer;

Thanks Kris
 
Kris,

Can you explain why you use this, in my idea is this a piece of code to make
old C developpers in C# happy.

Cor
 
In this piece of code it gets the data for each channel
using the bass.net library's


For a As Integer = 0 To length / 2 - 1
' decide on L/R channel
If a Mod 2 = 0 Then
' L channel
If data(a) > maxL Then
maxL = data(a)
End If
Else
' R channel
If data(a) > maxR Then
maxR = data(a)
End If
End If
Next
 
Kris Morrison said:
Hi i need some help to convert this to vb.net form C#

short* data =(short*)buffer;

Thanks Kris


You would have to translate/convert the entire unsafe block or code segment.
I don't think there is any direct equivelant in VB. This code may be useful
to you though:

Dim buffer As New Byte()
' fill the buffer somehow
Dim data As Short = BitConverter.ToInt16(buffer, 0)
 
Back
Top