Beispiel #1
0
        public static bool PlaySound(byte[] data, bool syncron, bool loop)
        {
            SoundFlags flags = SoundFlags.Resource;

            if (syncron)
            {
                flags |= SoundFlags.Syncron;
            }
            else
            {
                flags |= SoundFlags.Asyncron;
            }
            if (loop)
            {
                flags |= SoundFlags.Loop;
            }

            return(WinMM.PlaySound(data, UIntPtr.Zero, (uint)flags));
        }
Beispiel #2
0
        public static bool PlaySound(string filename, bool syncron, bool loop)
        {
            SoundFlags flags = SoundFlags.Filename;

            if (syncron)
            {
                flags |= SoundFlags.Syncron;
            }
            else
            {
                flags |= SoundFlags.Asyncron;
            }
            if (loop)
            {
                flags |= SoundFlags.Loop;
            }

            return(WinMM.PlaySound(filename, UIntPtr.Zero, (uint)flags));
        }
Beispiel #3
0
 public static bool PlaySound(byte[] data, SoundFlags flags)
 {
     return(WinMM.PlaySound(data, UIntPtr.Zero,
                            (uint)(flags | SoundFlags.Resource)));
 }
Beispiel #4
0
 public static bool PlaySound(string filename, SoundFlags flags)
 {
     return(WinMM.PlaySound(filename, UIntPtr.Zero,
                            (uint)(flags | SoundFlags.Filename)));
 }