M
MuZZy
Hi,
I just wonder if someone can help me wit this -
i have a byte[] array and need to convert it to short[] array, creating
short numbers by combining bytes by pairs:
My array: byte[0], byte[1], byte[2], etc.
I need: short[0] = byte[0]+byte[1], short[1] = byte[2]+byte[3], etc.
So my problem is how do i correctly convert two bytes into a two-byte
number here?
This problem comes from using windows multimedia API wavIn* functions
and in particular callback function, which returns a recorded block of
data as IntPtr and i copy it using Marshal.Copy to byte array. But for
sound analysis, in case when i have 16 bit per second sound, i need to
get a 2-byte number out of the byte array.
Any ideas would be highly appreciated!
Thank you,
Andrey
I just wonder if someone can help me wit this -
i have a byte[] array and need to convert it to short[] array, creating
short numbers by combining bytes by pairs:
My array: byte[0], byte[1], byte[2], etc.
I need: short[0] = byte[0]+byte[1], short[1] = byte[2]+byte[3], etc.
So my problem is how do i correctly convert two bytes into a two-byte
number here?
This problem comes from using windows multimedia API wavIn* functions
and in particular callback function, which returns a recorded block of
data as IntPtr and i copy it using Marshal.Copy to byte array. But for
sound analysis, in case when i have 16 bit per second sound, i need to
get a 2-byte number out of the byte array.
Any ideas would be highly appreciated!
Thank you,
Andrey