Пример #1
0
 public Channel PlaySound(Sound snd, bool paused = false)
 {
     IntPtr result = IntPtr.Zero;
     Errors.ThrowIfError(PlaySound(DangerousGetHandle(), ChannelIndex.Free, snd.DangerousGetHandle(), paused, ref result));
     return new Channel(result);
 }
Пример #2
0
 public Sound CreateStream(string path, SoundMode mode)
 {
     IntPtr resultHandle = IntPtr.Zero;
     Errors.ThrowIfError(CreateStream(DangerousGetHandle(), path, mode, 0, ref resultHandle));
     var result = new Sound(resultHandle);
     _sounds.Add(resultHandle, result);
     return result;
 }
Пример #3
0
 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;
 }
Пример #4
0
 public Sound CreateSound(byte[] data, SoundMode mode = SoundMode.Default)
 {
     IntPtr resultHandle = IntPtr.Zero;
     Errors.ThrowIfError(CreateSound(DangerousGetHandle(), data, mode, 0, ref resultHandle));
     var result = new Sound(resultHandle);
     _sounds.Add(resultHandle, result);
     return result;
 }