search for: ptrtostructure

Displaying 3 results from an estimated 3 matches for "ptrtostructure".

2006 Dec 28
0
using speex in C#
...port("libspeex.dll")] public static extern void speex_bits_init(ref SpeexBits bits); [DllImport("libspeex.dll")] public static extern int speex_encode_int(IntPtr state, Int16[] in_, ref SpeexBits bits); SpeexBits bits = new SpeexBits(); SpeexMode mode = (SpeexMode)Marshal.PtrToStructure(Speex.speex_lib_get_mode(1), typeof(SpeexMode)); Speex.speex_bits_init(ref bits); IntPtr enc_state = Speex.speex_encoder_init(ref mode); Int16[] CaptureData = null; (CaptureData receives data recorded from mic...) CaptureData = (Int16[])dsCapBuffer.Read(NextCaptureOffset, typeof(Int16), LockF...
2006 Dec 29
0
using speex in C#
...port("libspeex.dll")] public static extern void speex_bits_init(ref SpeexBits bits); [DllImport("libspeex.dll")] public static extern int speex_encode_int(IntPtr state, Int16[] in_, ref SpeexBits bits); SpeexBits bits = new SpeexBits(); SpeexMode mode = (SpeexMode)Marshal.PtrToStructure(Speex.speex_lib_get_mode(1), typeof(SpeexMode)); Speex.speex_bits_init(ref bits); IntPtr enc_state = Speex.speex_encoder_init(ref mode); Int16[] CaptureData = null; (CaptureData receives data recorded from mic...) CaptureData = (Int16[])dsCapBuffer.Read(NextCaptureOffset, typeof(Int16), LockF...
2008 Jul 30
1
Speex in VB .NET
...f bits As SpeexBits, ByVal outt() As Single) As Integer End Function #End Region End Class End Namespace With this code I am now able to init the decoder as follows: Dim speex_decoder_state As IntPtr Dim mode As Speex.Speex_win32.SpeexMode = DirectCast(Marshal.PtrToStructure(Speex.Speex_win32.speex_lib_get_mode(0), GetType(Speex.Speex_win32.SpeexMode)), Speex.Speex_win32.SpeexMode) speex_decoder_state = Speex.Speex_win32.speex_decoder_init(mode) and then I can do the following: Dim bits As New Speex.Speex_win32.SpeexBits Speex.Speex_win32.speex...