Esempio n. 1
0
        public void PlaySound(
            string wave,
            PlayDevices playDevice = PlayDevices.Both,
            bool isSync            = false,
            float?volume           = null)
        {
            if (!File.Exists(wave))
            {
                return;
            }

            if (!isSync)
            {
                Task.Run(() => SoundPlayerWrapper.Play(wave, playDevice, isSync, volume));
            }
            else
            {
                Task.Run(() =>
                {
                    lock (WaveBlocker)
                    {
                        SoundPlayerWrapper.Play(wave, playDevice, isSync, volume);
                    }
                });
            }
        }
Esempio n. 2
0
        public void PlaySound(
            string wave,
            int volume)
        {
            if (!File.Exists(wave))
            {
                return;
            }

            Task.Run(() => SoundPlayerWrapper.Play(wave));
        }
Esempio n. 3
0
        public void PlaySound(
            string wave,
            int volume,
            PlayDevices playDevice = PlayDevices.Both)
        {
            if (!File.Exists(wave))
            {
                return;
            }

            Task.Run(() => SoundPlayerWrapper.Play(wave, playDevice));
        }