WinVLC.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. namespace Speech.play {
  5. public class WinVLC : IPlaySystem {
  6. private string vlc_path;
  7. public WinVLC() {
  8. vlc_path = @"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe";
  9. }
  10. public Process Play(string path, string Device, int freq = 8000) {
  11. //vlc -I dummy --dummy-quiet t.mp3 vlc://quit
  12. Process p = new Process();
  13. List<string> arg = new List<string>();
  14. arg.Add("--stereo-mode=0");
  15. arg.Add("--no-video");
  16. arg.Add("--intf dummy");
  17. arg.Add("-I dummy");
  18. arg.Add("--dummy-quiet");
  19. arg.Add(path);
  20. arg.Add("vlc://quit");
  21. //p.StartInfo.FileName = this.vlc_path + " " + String.Join(' ', arg);
  22. p.StartInfo.FileName = this.vlc_path;
  23. p.StartInfo.Arguments = String.Join(' ', arg);
  24. p.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
  25. p.StartInfo.CreateNoWindow = false;
  26. return p;
  27. }
  28. public string GetName() {
  29. return "VLC Player for Windows";
  30. }
  31. }
  32. }