Advertisement
Guest User

Untitled

a guest
Oct 29th, 2016
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. var process = Process.Start(new ProcessStartInfo
  2. {
  3. FileName = "ffmpeg",
  4. Arguments = $"-i {pathOrUrl} -f s16le -ar 48000 -ac 2 pipe:1",
  5. UseShellExecute = false,
  6. RedirectStandardOutput = true
  7. });
  8. Thread.Sleep(2000);
  9.  
  10. int blockSize = 3840;
  11. byte[] buffer = new byte[blockSize];
  12. int byteCount;
  13.  
  14. while (true)
  15. {
  16. Console.WriteLine("Byte: " + (i += 1).ToString());
  17. byteCount = process.StandardOutput.BaseStream
  18. .Read(buffer, 0, blockSize);
  19.  
  20. if (byteCount == 0)
  21. break;
  22.  
  23. _vClient.Send(buffer, 0, byteCount);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement