private static extern ErrorCode CreateStream(IntPtr system, byte[] data, SoundMode mode, ref SoundInfo exinfo, ref IntPtr sound);
public Sound CreateStream(byte[] data, SoundMode mode, SoundInfo exinfo) { IntPtr resultHandle = IntPtr.Zero; Errors.ThrowIfError(CreateStream(DangerousGetHandle(), data, mode, ref exinfo, ref resultHandle)); var result = new Sound(resultHandle); _sounds.Add(resultHandle, result); return result; }
private static extern ErrorCode CreateStream(IntPtr system, string name, SoundMode mode, ref SoundInfo exinfo, ref IntPtr Sound);
public Sound CreateSound(string path, SoundMode mode, SoundInfo exinfo) { IntPtr resultHandle = IntPtr.Zero; Errors.ThrowIfError(CreateSound(DangerousGetHandle(), path, mode, ref exinfo, ref resultHandle)); var result = new Sound(resultHandle); _sounds.Add(resultHandle, result); return result; }