diff --git a/PressKeyByVoice/PressKeyByVoice/Form1.Designer.cs b/PressKeyByVoice/PressKeyByVoice/Form1.Designer.cs index c2631ff..18e4abf 100644 --- a/PressKeyByVoice/PressKeyByVoice/Form1.Designer.cs +++ b/PressKeyByVoice/PressKeyByVoice/Form1.Designer.cs @@ -52,9 +52,6 @@ private void InitializeComponent() this.label9 = new System.Windows.Forms.Label(); this.ToggleKeyInputBox = new System.Windows.Forms.TextBox(); this.label7 = new System.Windows.Forms.Label(); - this.ChunksPerSecondLabel = new System.Windows.Forms.Label(); - this.TimesPerSecondLabel = new System.Windows.Forms.Label(); - this.ChunksPerSecondTrackBar = new System.Windows.Forms.TrackBar(); this.SmoothingCheckbox = new System.Windows.Forms.CheckBox(); this.TresholdMaxLabel = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); @@ -66,12 +63,19 @@ private void InitializeComponent() this.label12 = new System.Windows.Forms.Label(); this.KeyPressDelayTrackBar = new System.Windows.Forms.TrackBar(); this.SaveButton = new System.Windows.Forms.Button(); + this.ChunksPerSecondTrackBar = new System.Windows.Forms.TrackBar(); + this.TimesPerSecondLabel = new System.Windows.Forms.Label(); + this.ChunksPerSecondLabel = new System.Windows.Forms.Label(); + this.BufferLabel = new System.Windows.Forms.Label(); + this.BufferTimesLabel = new System.Windows.Forms.Label(); + this.BufferTrackBar = new System.Windows.Forms.TrackBar(); ((System.ComponentModel.ISupportInitialize)(this.SensitivityTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TresholdTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.StatusBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ChunksPerSecondTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TresholdMaxTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.KeyPressDelayTrackBar)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ChunksPerSecondTrackBar)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.BufferTrackBar)).BeginInit(); this.SuspendLayout(); // // PeakVolumeBar @@ -297,40 +301,10 @@ private void InitializeComponent() this.label7.TabIndex = 24; this.label7.Text = "Debug textbox, ignore this..."; // - // ChunksPerSecondLabel - // - this.ChunksPerSecondLabel.AutoSize = true; - this.ChunksPerSecondLabel.Location = new System.Drawing.Point(126, 316); - this.ChunksPerSecondLabel.Name = "ChunksPerSecondLabel"; - this.ChunksPerSecondLabel.Size = new System.Drawing.Size(25, 13); - this.ChunksPerSecondLabel.TabIndex = 27; - this.ChunksPerSecondLabel.Text = "100"; - // - // TimesPerSecondLabel - // - this.TimesPerSecondLabel.AutoSize = true; - this.TimesPerSecondLabel.Location = new System.Drawing.Point(23, 316); - this.TimesPerSecondLabel.Name = "TimesPerSecondLabel"; - this.TimesPerSecondLabel.Size = new System.Drawing.Size(97, 13); - this.TimesPerSecondLabel.TabIndex = 26; - this.TimesPerSecondLabel.Text = "Times Per Second:"; - // - // ChunksPerSecondTrackBar - // - this.ChunksPerSecondTrackBar.BackColor = System.Drawing.SystemColors.Control; - this.ChunksPerSecondTrackBar.Location = new System.Drawing.Point(23, 332); - this.ChunksPerSecondTrackBar.Maximum = 1000; - this.ChunksPerSecondTrackBar.Minimum = 1; - this.ChunksPerSecondTrackBar.Name = "ChunksPerSecondTrackBar"; - this.ChunksPerSecondTrackBar.Size = new System.Drawing.Size(268, 45); - this.ChunksPerSecondTrackBar.TabIndex = 25; - this.ChunksPerSecondTrackBar.Value = 100; - this.ChunksPerSecondTrackBar.ValueChanged += new System.EventHandler(this.ChunksPerSecondTrackBar_ValueChanged); - // // SmoothingCheckbox // this.SmoothingCheckbox.AutoSize = true; - this.SmoothingCheckbox.Location = new System.Drawing.Point(26, 372); + this.SmoothingCheckbox.Location = new System.Drawing.Point(26, 383); this.SmoothingCheckbox.Name = "SmoothingCheckbox"; this.SmoothingCheckbox.Size = new System.Drawing.Size(244, 17); this.SmoothingCheckbox.TabIndex = 28; @@ -449,11 +423,73 @@ private void InitializeComponent() this.SaveButton.UseVisualStyleBackColor = true; this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); // + // ChunksPerSecondTrackBar + // + this.ChunksPerSecondTrackBar.BackColor = System.Drawing.SystemColors.Control; + this.ChunksPerSecondTrackBar.Location = new System.Drawing.Point(23, 332); + this.ChunksPerSecondTrackBar.Maximum = 1000; + this.ChunksPerSecondTrackBar.Minimum = 1; + this.ChunksPerSecondTrackBar.Name = "ChunksPerSecondTrackBar"; + this.ChunksPerSecondTrackBar.Size = new System.Drawing.Size(268, 45); + this.ChunksPerSecondTrackBar.TabIndex = 25; + this.ChunksPerSecondTrackBar.Value = 100; + this.ChunksPerSecondTrackBar.ValueChanged += new System.EventHandler(this.ChunksPerSecondTrackBar_ValueChanged); + // + // TimesPerSecondLabel + // + this.TimesPerSecondLabel.AutoSize = true; + this.TimesPerSecondLabel.Location = new System.Drawing.Point(23, 316); + this.TimesPerSecondLabel.Name = "TimesPerSecondLabel"; + this.TimesPerSecondLabel.Size = new System.Drawing.Size(97, 13); + this.TimesPerSecondLabel.TabIndex = 26; + this.TimesPerSecondLabel.Text = "Times Per Second:"; + // + // ChunksPerSecondLabel + // + this.ChunksPerSecondLabel.AutoSize = true; + this.ChunksPerSecondLabel.Location = new System.Drawing.Point(126, 316); + this.ChunksPerSecondLabel.Name = "ChunksPerSecondLabel"; + this.ChunksPerSecondLabel.Size = new System.Drawing.Size(25, 13); + this.ChunksPerSecondLabel.TabIndex = 27; + this.ChunksPerSecondLabel.Text = "100"; + // + // BufferLabel + // + this.BufferLabel.AutoSize = true; + this.BufferLabel.Location = new System.Drawing.Point(126, 316); + this.BufferLabel.Name = "BufferLabel"; + this.BufferLabel.Size = new System.Drawing.Size(13, 13); + this.BufferLabel.TabIndex = 504; + this.BufferLabel.Text = "1"; + // + // BufferTimesLabel + // + this.BufferTimesLabel.AutoSize = true; + this.BufferTimesLabel.Location = new System.Drawing.Point(23, 316); + this.BufferTimesLabel.Name = "BufferTimesLabel"; + this.BufferTimesLabel.Size = new System.Drawing.Size(62, 13); + this.BufferTimesLabel.TabIndex = 503; + this.BufferTimesLabel.Text = "Buffer times"; + // + // BufferTrackBar + // + this.BufferTrackBar.BackColor = System.Drawing.SystemColors.Control; + this.BufferTrackBar.Location = new System.Drawing.Point(23, 332); + this.BufferTrackBar.Minimum = 1; + this.BufferTrackBar.Name = "BufferTrackBar"; + this.BufferTrackBar.Size = new System.Drawing.Size(268, 45); + this.BufferTrackBar.TabIndex = 502; + this.BufferTrackBar.Value = 1; + this.BufferTrackBar.ValueChanged += new System.EventHandler(this.BufferTrackBar_ValueChanged); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(631, 397); + this.ClientSize = new System.Drawing.Size(631, 402); + this.Controls.Add(this.BufferLabel); + this.Controls.Add(this.BufferTimesLabel); + this.Controls.Add(this.BufferTrackBar); this.Controls.Add(this.SaveButton); this.Controls.Add(this.SmoothingCheckbox); this.Controls.Add(this.label10); @@ -499,9 +535,10 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.SensitivityTrackBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.TresholdTrackBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.StatusBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ChunksPerSecondTrackBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.TresholdMaxTrackBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.KeyPressDelayTrackBar)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ChunksPerSecondTrackBar)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.BufferTrackBar)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -533,9 +570,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label9; private System.Windows.Forms.TextBox ToggleKeyInputBox; private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label ChunksPerSecondLabel; - private System.Windows.Forms.Label TimesPerSecondLabel; - private System.Windows.Forms.TrackBar ChunksPerSecondTrackBar; private System.Windows.Forms.CheckBox SmoothingCheckbox; private System.Windows.Forms.Label TresholdMaxLabel; private System.Windows.Forms.Label label14; @@ -547,6 +581,12 @@ private void InitializeComponent() private System.Windows.Forms.Label label12; private System.Windows.Forms.TrackBar KeyPressDelayTrackBar; private System.Windows.Forms.Button SaveButton; + private System.Windows.Forms.TrackBar ChunksPerSecondTrackBar; + private System.Windows.Forms.Label TimesPerSecondLabel; + private System.Windows.Forms.Label ChunksPerSecondLabel; + private System.Windows.Forms.Label BufferLabel; + private System.Windows.Forms.Label BufferTimesLabel; + private System.Windows.Forms.TrackBar BufferTrackBar; } } diff --git a/PressKeyByVoice/PressKeyByVoice/Form1.cs b/PressKeyByVoice/PressKeyByVoice/Form1.cs index 506d588..c16518e 100644 --- a/PressKeyByVoice/PressKeyByVoice/Form1.cs +++ b/PressKeyByVoice/PressKeyByVoice/Form1.cs @@ -43,6 +43,7 @@ public partial class Form1 : Form public bool keyReleaserRunning = false; public int keepingTrack = 0; public int globalCounter = 0; + public int globalBuffer = 1; //all the extern methods imported @@ -74,6 +75,7 @@ public Form1() smoothing = data.smoothing; waveMode = data.waveMode; peakMode = data.peakMode; + globalBuffer = data.globalBuffer; int val = keyToBePressed; foreach (VirtualKeyCode vk in Enum.GetValues(typeof(VirtualKeyCode))) @@ -95,6 +97,8 @@ public Form1() KeyPressDelayLabel.Text = keyPressDuration.ToString(); KeyPressDelayTrackBar.Value = keyPressDuration; SmoothingCheckbox.Checked = smoothing; + BufferLabel.Text = globalBuffer.ToString(); + BufferTrackBar.Value = globalBuffer; CurrentKey.Text = char.ToLower(keyToBePressed).ToString(); KeyTextBox.Text = char.ToLower(keyToBePressed).ToString(); ToggleKeyLabel.Text = ((VirtualKeyCode)DisableEnableKey).ToString(); @@ -130,12 +134,21 @@ public Form1() WaveModeCheckbox.Checked = waveMode; PeakModeCheckbox.Checked = peakMode; - ChunksPerSecondTrackBar.Enabled = false; - ChunksPerSecondTrackBar.Visible = false; - ChunksPerSecondLabel.Visible = false; - TimesPerSecondLabel.Visible = false; - SmoothingCheckbox.Enabled = false; - SmoothingCheckbox.Visible = false; + if (waveMode) + { + ChunksPerSecondTrackBar.Enabled = false; + ChunksPerSecondTrackBar.Visible = false; + ChunksPerSecondLabel.Visible = false; + TimesPerSecondLabel.Visible = false; + SmoothingCheckbox.Enabled = false; + SmoothingCheckbox.Visible = false; + } else + { + BufferLabel.Visible = false; + BufferTrackBar.Visible = false; + BufferTimesLabel.Visible = false; + BufferTrackBar.Enabled = false; + } //Get all process currently running: @@ -193,7 +206,7 @@ private void AudioDeviceComboBox_SelectedIndexChanged(object sender, EventArgs e waveDeviceId = index; sourceStream = new WaveInEvent(); sourceStream.DeviceNumber = waveDeviceId; - sourceStream.WaveFormat = new WaveFormat(44100, WaveIn.GetCapabilities(index).Channels); + sourceStream.WaveFormat = new WaveFormat(48000, WaveIn.GetCapabilities(index).Channels); sourceStream.DataAvailable += new EventHandler(sourceStream_DataAvailable); sourceStream.StartRecording(); DebugTextBox.Text = "Selected device: " + index; @@ -202,45 +215,58 @@ private void AudioDeviceComboBox_SelectedIndexChanged(object sender, EventArgs e private void sourceStream_DataAvailable(object sender, WaveInEventArgs e) { - float[] amplitudes = new float[e.BytesRecorded]; - byte[] buffer = e.Buffer; - - int counter = 0; - for (int index = 0; index < e.BytesRecorded; index += 2) - { - short sample = (short)((buffer[index + 1] << 8) | - buffer[index + 0]); - float sample32 = sample / 32768f; - amplitudes[counter] = sample32; - counter++; - } - //int volume = (int)(((((bytesAsInts.Average() / 10) - 10) * 100) - 200) / (1000 / sensitivity)); - try + + if (!keyReleaserRunning) { - int volume = (int)(amplitudes.Max() * 10 * sensitivity); + float[] amplitudes = new float[e.BytesRecorded]; + byte[] buffer = e.Buffer; - if (volume > treshold && volume < maxTreshold) + int counter = 0; + for (int index = 0; index < e.BytesRecorded; index += 2) { - if (selectedProcess != null) + short sample = (short)((buffer[index + 1] << 8) | + buffer[index + 0]); + float sample32 = sample / 32768f; + amplitudes[counter] = sample32; + counter++; + } + //int volume = (int)(((((bytesAsInts.Average() / 10) - 10) * 100) - 200) / (1000 / sensitivity)); + try + { + int volume = (int)(amplitudes.Max() * 10 * sensitivity); + keepingTrack = keepingTrack + volume; + if(globalCounter > (globalBuffer - 1)) { - if (selectedProcess.Id == GetActiveProcessID()) + volume = keepingTrack / globalBuffer; + if (volume > treshold && volume < maxTreshold) { - if (!keyReleaserRunning) + if (selectedProcess != null) { - keyReleaser = new Thread(new ThreadStart(() => KeyReleaser())); - try { keyReleaser.Start(); } catch { }; - + if (selectedProcess.Id == GetActiveProcessID()) + { + /* keyReleaser = new Thread(new ThreadStart(() => KeyReleaser())); + try { keyReleaser.Start(); } catch { };*/ + DateTime _desired = DateTime.Now.AddMilliseconds(keyPressDuration); + while (DateTime.Now < _desired) + { + sim.Keyboard.KeyDown(key); + Thread.Sleep(1); + } + UpdateStatusBoxColor(Color.Red); + } } } + UpdatePeakVolumeBar(volume); + keepingTrack = 0; + globalCounter = 0; } + + globalCounter++; + } catch(Exception ex) + { + UpdateDebugText("Couldnt update volume bar:" + ex.ToString()); } - UpdatePeakVolumeBar(volume); - } catch(Exception ex) - { - UpdateDebugText("Couldnt update volume bar:" + ex.ToString()); } - - } private void UpdateKeyPressStatusText(string text) @@ -338,9 +364,8 @@ private void UpdatePeakVolumeBar(int volume) { if (selectedProcess.Id == GetActiveProcessID()) { - /*Thread keyReleaser = new Thread(new ThreadStart(() => KeyReleaser())); - keyReleaser.Start();*/ - sim.Keyboard.KeyDown(key); + Thread keyReleaser = new Thread(new ThreadStart(() => KeyReleaser())); + keyReleaser.Start(); KeyPressStatusLabel.Text = "Key " + keyToBePressed.ToString() + " is currently being pressed!"; } } @@ -658,6 +683,13 @@ private void ChunksPerSecondTrackBar_ValueChanged(object sender, EventArgs e) ChunksPerSecondLabel.Text = ChunksPerSecondTrackBar.Value.ToString(); } + + private void BufferTrackBar_ValueChanged(object sender, EventArgs e) + { + globalBuffer = BufferTrackBar.Value; + BufferLabel.Text = globalBuffer.ToString(); + } + private void SmoothingCheckbox_CheckedChanged(object sender, EventArgs e) { if (SmoothingCheckbox.Checked) @@ -709,6 +741,10 @@ private void WaveModeCheckbox_Click(object sender, EventArgs e) TimesPerSecondLabel.Visible = false; SmoothingCheckbox.Enabled = false; SmoothingCheckbox.Visible = false; + BufferLabel.Visible = true; + BufferTrackBar.Visible = true; + BufferTimesLabel.Visible = true; + BufferTrackBar.Enabled = true; waveMode = WaveModeCheckbox.Checked; int waveInDevices = WaveIn.DeviceCount; @@ -742,6 +778,10 @@ private void PeakModeCheckbox_Click(object sender, EventArgs e) TimesPerSecondLabel.Visible = true; SmoothingCheckbox.Enabled = true; SmoothingCheckbox.Visible = true; + BufferLabel.Visible = false; + BufferTrackBar.Visible = false; + BufferTimesLabel.Visible = false; + BufferTrackBar.Enabled = false; peakMode = PeakModeCheckbox.Checked; @@ -881,6 +921,7 @@ private void SaveButton_Click(object sender, EventArgs e) data.peakDeviceId = peakDeviceId; data.keyToBePressed = keyToBePressed; data.smoothing = smoothing; + data.globalBuffer = globalBuffer; data.waveMode = waveMode; data.peakMode = peakMode; data.SaveData(); diff --git a/PressKeyByVoice/PressKeyByVoice/SettingsData.cs b/PressKeyByVoice/PressKeyByVoice/SettingsData.cs index 59e65e3..f5844b5 100644 --- a/PressKeyByVoice/PressKeyByVoice/SettingsData.cs +++ b/PressKeyByVoice/PressKeyByVoice/SettingsData.cs @@ -23,15 +23,16 @@ public class SettingsData public int keyPressDuration = 1000; public int waveDeviceId = 0; public int peakDeviceId = 0; + public int globalBuffer = 1; public char keyToBePressed = (char)86; public bool smoothing = false; public bool waveMode = true; public bool peakMode = false; - public string settingsPath = "\\Settings.ini"; + public string settingsPath = "\\SettingsV1_4.ini"; public SettingsData() { - settingsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\PressKeyByVoice\\Settings.ini"; + settingsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\PressKeyByVoice\\SettingsV1_4.ini"; if(!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\PressKeyByVoice")) { @@ -41,7 +42,7 @@ public SettingsData() { //File.Create(settingsPath); int character = keyToBePressed; - string defaultSettings = @"sensitivity = " + sensitivity.ToString() + ";treshold = " + treshold.ToString() + ";maxTreshold = " + maxTreshold.ToString() + ";recordSpeed = " + recordSpeed.ToString() + ";DisableEnableKey = " + DisableEnableKey.ToString() + ";keyPressDuration = " + keyPressDuration.ToString() + ";waveDeviceId = " + waveDeviceId.ToString() + ";peakDeviceId = " + peakDeviceId.ToString() + ";keyToBePressed = " + character.ToString() + ";smoothing = " + smoothing.ToString() + ";waveMode = " + waveMode.ToString() + ";peakMode = " + peakMode.ToString() + ";"; + string defaultSettings = @"sensitivity = " + sensitivity.ToString() + ";treshold = " + treshold.ToString() + ";maxTreshold = " + maxTreshold.ToString() + ";recordSpeed = " + recordSpeed.ToString() + ";DisableEnableKey = " + DisableEnableKey.ToString() + ";keyPressDuration = " + keyPressDuration.ToString() + ";waveDeviceId = " + waveDeviceId.ToString() + ";peakDeviceId = " + peakDeviceId.ToString() + ";keyToBePressed = " + character.ToString() + ";smoothing = " + smoothing.ToString() + ";waveMode = " + waveMode.ToString() + ";peakMode = " + peakMode.ToString() + ";buffer = " + globalBuffer.ToString() + ";"; TextWriter tw = new StreamWriter(settingsPath, true); tw.WriteLine(defaultSettings); @@ -149,6 +150,12 @@ public SettingsData() parseSucces = false; } } + else if (setting.Contains("buffer")) + { + int value = 0; + parseSucces = int.TryParse(setting.Split('=')[1].Trim(), out value); + globalBuffer = value; + } if (!parseSucces) { @@ -172,7 +179,7 @@ public void SaveData() { File.CreateText(settingsPath); int character = keyToBePressed; - string defaultSettings = @"sensitivity = " + sensitivity.ToString() + ";treshold = " + treshold.ToString() + ";maxTreshold = " + maxTreshold.ToString() + ";recordSpeed = " + recordSpeed.ToString() + ";DisableEnableKey = " + DisableEnableKey.ToString() + ";keyPressDuration = " + keyPressDuration.ToString() + ";waveDeviceId = " + waveDeviceId.ToString() + ";peakDeviceId = " + peakDeviceId.ToString() + ";keyToBePressed = " + character.ToString() + ";smoothing = " + smoothing.ToString() + ";waveMode = " + waveMode.ToString() + ";peakMode = " + peakMode.ToString() + ";"; + string defaultSettings = @"sensitivity = " + sensitivity.ToString() + ";treshold = " + treshold.ToString() + ";maxTreshold = " + maxTreshold.ToString() + ";recordSpeed = " + recordSpeed.ToString() + ";DisableEnableKey = " + DisableEnableKey.ToString() + ";keyPressDuration = " + keyPressDuration.ToString() + ";waveDeviceId = " + waveDeviceId.ToString() + ";peakDeviceId = " + peakDeviceId.ToString() + ";keyToBePressed = " + character.ToString() + ";smoothing = " + smoothing.ToString() + ";waveMode = " + waveMode.ToString() + ";peakMode = " + peakMode.ToString() + ";buffer = " + globalBuffer.ToString() + ";"; TextWriter tw = new StreamWriter(settingsPath); tw.WriteLine(defaultSettings); tw.Close(); @@ -181,7 +188,7 @@ public void SaveData() { int character = keyToBePressed; - string defaultSettings = @"sensitivity = " + sensitivity.ToString() + ";treshold = " + treshold.ToString() + ";maxTreshold = " + maxTreshold.ToString() + ";recordSpeed = " + recordSpeed.ToString() + ";DisableEnableKey = " + DisableEnableKey.ToString() + ";keyPressDuration = " + keyPressDuration.ToString() + ";waveDeviceId = " + waveDeviceId.ToString() + ";peakDeviceId = " + peakDeviceId.ToString() + ";keyToBePressed = " + character.ToString() + ";smoothing = " + smoothing.ToString() + ";waveMode = " + waveMode.ToString() + ";peakMode = " + peakMode.ToString() + ";"; + string defaultSettings = @"sensitivity = " + sensitivity.ToString() + ";treshold = " + treshold.ToString() + ";maxTreshold = " + maxTreshold.ToString() + ";recordSpeed = " + recordSpeed.ToString() + ";DisableEnableKey = " + DisableEnableKey.ToString() + ";keyPressDuration = " + keyPressDuration.ToString() + ";waveDeviceId = " + waveDeviceId.ToString() + ";peakDeviceId = " + peakDeviceId.ToString() + ";keyToBePressed = " + character.ToString() + ";smoothing = " + smoothing.ToString() + ";waveMode = " + waveMode.ToString() + ";peakMode = " + peakMode.ToString() + ";buffer = " + globalBuffer.ToString() + ";"; TextWriter tw = new StreamWriter(settingsPath); tw.WriteLine(defaultSettings); tw.Close(); diff --git a/PressKeyByVoiceV1.4.exe b/PressKeyByVoiceV1.4.exe new file mode 100644 index 0000000..9164ca4 Binary files /dev/null and b/PressKeyByVoiceV1.4.exe differ