/// <summary> /// Initializes a new instance of the <see cref="XAudio2Buffer" /> structure. /// </summary> /// <param name="bufferSize"></param> public XAudio2Buffer(int bufferSize) { AudioDataPtr = Marshal.AllocHGlobal(bufferSize); //todo: may need to align buffer? //AudioDataPtr = AllocateMemory(bufferSize); AudioBytes = bufferSize; Flags = XAudio2BufferFlags.None; ContextPtr = IntPtr.Zero; LoopBegin = 0; LoopLength = 0; LoopCount = 0; PlayBegin = 0; PlayLength = 0; }
/// <summary> /// Initializes a new instance of the <see cref="XAudio2Buffer" /> structure. /// </summary> /// <param name="bufferSize"></param> public XAudio2Buffer(int bufferSize) { AudioDataPtr = Marshal.AllocHGlobal(bufferSize); //todo: may need to align buffer? //AudioDataPtr = AllocateMemory(bufferSize); AudioBytes = bufferSize; Flags = XAudio2BufferFlags.None; ContextPtr = IntPtr.Zero; LoopBegin = 0; LoopLength = 0; LoopCount = 0; PlayBegin = 0; PlayLength = 0; }