Exemplo n.º 1
0
        public static void ChangePlaybakcDevice(string name)
        {
            int deviceNumber = SimpleAudioPlayer.GetDeviceNumber(name);
            var player       = Interlocked.Exchange(ref _SpeechPlayer, new SimpleAudioPlayer(deviceNumber));

            player.Dispose();

            _SpeechPlayer.PlaybackStopped += OnPlayerStopped;
            _SpeechPlayer.VoiceName        = _CurrentVoice;
            StartPlayback();
        }
Exemplo n.º 2
0
        public static void Initialize()
        {
            var isInitialized = Interlocked.Exchange(ref _IsInitialized, 1);

            if (isInitialized == 1)
            {
                return;
            }
            _SpeechPlayer = new SimpleAudioPlayer();
            _SpeechPlayer.PlaybackStopped += OnPlayerStopped;

            App.ApplicationExit += (e) =>
            {
                _SpeechPlayer?.Dispose();
            };
        }
Exemplo n.º 3
0
 public static string[] GetPlaybackDeviceNames()
 {
     return(SimpleAudioPlayer.GetPlaybackDeviceNames());
 }