Example #1
0
 public void Stop()
 {
     if (_primarySoundPlayer != null)
     {
         _primarySoundPlayer.Stop();
     }
     if (_secondarySoundPlayer != null)
     {
         _secondarySoundPlayer.Stop();
     }
 }
Example #2
0
        private string ChangeDevice(string deviceName, float deviceVolume, ref AudioPlaybackEngine soundPlayer)
        {
            if (soundPlayer != null)
            {
                soundPlayer.Stop();
                soundPlayer.Dispose();
            }

            string selectedDeviceName = InstantiateDevice(deviceName, soundPlayer == _primarySoundPlayer, ref soundPlayer);

            if (soundPlayer != null)
            {
                soundPlayer.Overlap = Overlap;
                soundPlayer.Volume  = _volume * deviceVolume;
            }

            return(selectedDeviceName);
        }