public unsafe static bool BASS_Encode_GetACMFormat(int handle, ref ACMFORMAT codec, string title, BASSACMFormat flags) { int num = BassEnc.BASS_Encode_GetACMFormatUnicode(0, IntPtr.Zero, 0, null, BASSACMFormat.BASS_ACM_NONE); byte[] array = new byte[(num > codec.FormatLength) ? num : codec.FormatLength]; bool result = false; byte[] array2 = new byte[Marshal.SizeOf(codec) + (int)codec.waveformatex.cbSize]; int num2 = Marshal.SizeOf(codec); IntPtr intPtr = Marshal.AllocHGlobal(num2); Marshal.StructureToPtr(codec, intPtr, false); Marshal.Copy(intPtr, array2, 0, num2); Marshal.FreeHGlobal(intPtr); for (int i = 0; i < codec.extension.Length; i++) { array2[18 + i] = codec.extension[i]; } Array.Copy(array2, array, num2); fixed(byte *ptr = array) { if (BassEnc.BASS_Encode_GetACMFormat(handle, (IntPtr)((void *)ptr), num, title, flags) > 0) { codec = new ACMFORMAT((IntPtr)((void *)ptr)); result = true; } } return(result); }
public unsafe static ACMFORMAT BASS_Encode_GetACMFormatSuggest(int handle, BASSACMFormat flags, WAVEFormatTag format) { ACMFORMAT result = null; int num = BassEnc.BASS_Encode_GetACMFormatUnicode(0, IntPtr.Zero, 0, null, BASSACMFormat.BASS_ACM_NONE); fixed(byte *ptr = new byte[num]) { if (BassEnc.BASS_Encode_GetACMFormat(handle, (IntPtr)((void *)ptr), num, null, (BASSACMFormat)Utils.MakeLong((int)flags, (int)format)) > 0) { result = new ACMFORMAT((IntPtr)((void *)ptr)); } } return(result); }
public static int BASS_Encode_GetACMFormat(int handle, IntPtr form, int fromlen, string title, BASSACMFormat flags) { flags |= BASSACMFormat.BASS_UNICODE; return(BassEnc.BASS_Encode_GetACMFormatUnicode(handle, form, fromlen, title, flags)); }