public static void INIT() { var R = TermController.RunCommand("fbset", "-i"); Thread.Sleep(100); while (true) { string line = ""; try { line = R.ReadLine(); } catch { throw new MissingFieldException(); } if (line.StartsWith("mode \"")) { string[] info = line.Substring(6).Split(new char[] { 'x' }, StringSplitOptions.RemoveEmptyEntries); info[1].Substring(0, info[1].Length - 1); X = int.Parse(info[0]); Y = int.Parse(info[1]); BufferSize = X * Y; IMG = new LCDIMG() { Buffer = new byte[BufferSize], LineLength = X }; break; } } R.Close(); }
public static void PlayWav(string path) { if (path.Contains(".wav")) { TermController.RunCommand("aplay", path); } else { throw new ArgumentOutOfRangeException(); } }
public static void Say(string text) { TermController.RunCommandWithPipe(TermController.RunCommand("espeak", $"\"{text}\" --stdout"), "aplay", ""); }
public static void PlayTone(int hz, int timeMS) { TermController.RunCommand("beep", $"-f {hz} -l {timeMS}"); }