Example #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));
        }
Example #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));
        }
Example #3
0
 public static bool PlaySound(byte[] data, SoundFlags flags)
 {
     return(WinMM.PlaySound(data, UIntPtr.Zero,
                            (uint)(flags | SoundFlags.Resource)));
 }
Example #4
0
 public static bool PlaySound(string filename, SoundFlags flags)
 {
     return(WinMM.PlaySound(filename, UIntPtr.Zero,
                            (uint)(flags | SoundFlags.Filename)));
 }