Example #1
0
        public Form1()
        {
            _serialPort.PortName = "COM6";
            _serialPort.BaudRate = 9600;
            _serialPort.Parity = Parity.None;
            _serialPort.DataBits = 8;
            _serialPort.StopBits = StopBits.Two;
            _serialPort.Handshake = Handshake.None;
            _serialPort.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived);

            _serialPort.Open();

            //Set up audio outputs
            jaws[0] = new WaveOut();
            jaws[1] = new WaveOut();
            jaws[2] = new WaveOut();

            var jawsAudio1 = new WaveChannel32(new WaveFileReader("Sounds/Jaws3.wav"));
            jaws[0].Init(jawsAudio1);
            var jawsAudio2 = new LoopStream(new WaveFileReader("Sounds/Jaws2.wav"));
            jaws[1].Init(jawsAudio2);
            var jawsAudio3 = new LoopStream(new WaveFileReader("Sounds/Jaws1.wav"));
            jaws[2].Init(jawsAudio3);

            //Set the shark to a random position
            resetShark();

            InitializeComponent();
        }
Example #2
0
        public Form1()
        {
            _serialPort.PortName      = "COM6";
            _serialPort.BaudRate      = 9600;
            _serialPort.Parity        = Parity.None;
            _serialPort.DataBits      = 8;
            _serialPort.StopBits      = StopBits.Two;
            _serialPort.Handshake     = Handshake.None;
            _serialPort.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived);

            _serialPort.Open();

            //Set up audio outputs
            jaws[0] = new WaveOut();
            jaws[1] = new WaveOut();
            jaws[2] = new WaveOut();

            var jawsAudio1 = new WaveChannel32(new WaveFileReader("Sounds/Jaws3.wav"));

            jaws[0].Init(jawsAudio1);
            var jawsAudio2 = new LoopStream(new WaveFileReader("Sounds/Jaws2.wav"));

            jaws[1].Init(jawsAudio2);
            var jawsAudio3 = new LoopStream(new WaveFileReader("Sounds/Jaws1.wav"));

            jaws[2].Init(jawsAudio3);

            //Set the shark to a random position
            resetShark();


            InitializeComponent();
        }