Example #1
0
        //This stops the recording functionality and does the speack to text convertion
        //INPUT:
        //OUTPUT:
        private void stopRecording()
        {
            //Stop the timer
            timerClock.Stop();


            //stop recordinmg from the microphone
            audioCapture a = new audioCapture();

            a.OnRecordingStopped(null, null);

            //Enable/Disable the buttons as required
            btnStartCommand.Enabled = true;
            btnStopCommand.Enabled  = false;

            //Show the length of the sample for the user to see
            double sampleLength = (audioCapture.recordingEnded - audioCapture.recordingStarted).TotalMilliseconds * 0.001;

            lblRecordingLength.Text = Math.Round(sampleLength, 2).ToString();
            //If the sample lenght is greater than 2.5 seconds

            if (doSpeechTextValidation())
            {
                string sitekey       = "";
                string username      = "";
                string website       = "";
                string encryptedPass = "";
                bool   keyFound      = false;


                //If we find a valid login, then find the matching website and login credientials
                foreach (DataGridViewRow dr in dgvUserAccounts.Rows)
                {
                    sitekey       = dr.Cells["SiteKey"].Value.ToString();
                    username      = dr.Cells["username"].Value.ToString();
                    website       = dr.Cells["website"].Value.ToString();
                    encryptedPass = dr.Cells["password"].Value.ToString();
                    if (txtTextRecognises.Text.ToLower().Contains(sitekey.ToLower()))
                    {
                        keyFound = true;
                        break;
                    }
                }
                if (keyFound)
                {
                    EncryptionDecrypt ende = new EncryptionDecrypt();
                    frmWebLoader      f    = new frmWebLoader(website, username, ende.Decrypt(encryptedPass));
                    f.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Unable to find matching logon details for the command spoken");
                }
            }
            else
            {
                MessageBox.Show("Do Nothing here");
            }
        }
Example #2
0
        //This stops the recording functionality and starts the validation
        //INPUT:
        //OUPUT
        private void stopRecording()
        {
            //Stop the timer
            timerClock.Stop();

            lblValidation.ForeColor = Color.Black;

            //stop recordinmg from the microphone
            audioCapture a = new audioCapture();

            a.OnRecordingStopped(null, null);

            //Enable/Disable the buttons as required
            btnRecord.Enabled        = true;
            btnStopRecording.Enabled = false;

            //Show the length of the sample for the user to see
            double sampleLength = (audioCapture.recordingEnded - audioCapture.recordingStarted).TotalMilliseconds * 0.001;

            lblRecordingLength.Text = Math.Round(sampleLength, 2).ToString();
            //If the sample lenght is greater than 2.5 seconds
            if (sampleLength > 2.5)
            {
                //Start the progress bar so the user can see something is happening
                progressBar1.Style = ProgressBarStyle.Marquee;
                lblValidation.Text = "Validating, please wait";
                if (doSpeechTextValidation(txtTextToRead.Text))
                {
                    performSpeakerValidation();
                    validSpeech = true;
                }
                // if (chkAutoLogin.Checked == true) btnContinue_Click(null, null);
                else
                {
                    validSpeech             = false;
                    progressBar1.Style      = ProgressBarStyle.Continuous;
                    lblValidation.Text      = "Invalid User";
                    lblValidation.ForeColor = Color.Salmon;
                }
            }
        }
Example #3
0
        //This stops the recording functionality
        private void stopRecording()
        {
            //Stop the timer
            timerClock.Stop();
            //stop recordinmg from the microphone
            audioCapture a = new audioCapture();

            a.OnRecordingStopped(null, null);

            //Enable/Disable the buttons as required
            btnRecord.Enabled        = true;
            btnStopRecording.Enabled = false;

            //Show the length of the sample for the user to see
            double sampleLength = (audioCapture.recordingEnded - audioCapture.recordingStarted).TotalMilliseconds * 0.001;

            lblRecordingLength.Text = Math.Round(sampleLength, 2).ToString();
            //If the sample lenght is greater than 5 seconds
            if (sampleLength > 5)
            {
                btnCreate.Enabled = true;
            }
        }
Example #4
0
        private void btnStopRecord1_Click(object sender, EventArgs e)
        {
            timerClock.Stop();
            audioCapture a = new audioCapture();

            a.OnRecordingStopped(sender, null);

            //This create the wave output that is shown on the screen
            var waveFormat = WaveFormat.CreateMuLawFormat(8000, 1);

            using (var x = new RawSourceWaveStream(audioStream1, waveFormat))
            {
                waveViewerSample1.WaveStream = x;
            }

            //Enable/Disable the buttons as required

            setValidStream(true);

            //Show the length of the sample for the user to see
            double sampleLength = (audioCapture.recordingEnded - audioCapture.recordingStarted).TotalMilliseconds * 0.001;

            lblSample1Length.Text = Math.Round(sampleLength, 2).ToString();
        }