Skip to content

Commit 673204a

Browse files
committed
Initial commit
0 parents  commit 673204a

30 files changed

+7576
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>

Form1.Designer.cs

Lines changed: 155 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Form1.cs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using System;
2+
using System.Drawing;
3+
using System.IO;
4+
using System.Windows.Forms;
5+
using System.Speech.Synthesis;
6+
7+
namespace NoteReader
8+
{
9+
public partial class Form1 : Form{
10+
private StreamReader _stream;
11+
private SpeechSynthesizer _synth;
12+
13+
public Form1()
14+
{
15+
InitializeComponent();
16+
_synth = new SpeechSynthesizer();
17+
}
18+
19+
private void loadNotesButton_Click(object sender, EventArgs e)
20+
{
21+
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
22+
{
23+
_stream = new StreamReader(openFileDialog1.FileName);
24+
notesLabel.Text = openFileDialog1.FileName;
25+
}
26+
}
27+
28+
private void Form1_Load(object sender, EventArgs e){
29+
statusLabel.Text = "Waiting";
30+
currentLineLabel.Enabled = false;
31+
textBox1.Enabled = false;
32+
progressBar1.BackColor = Color.Black;
33+
progressBar1.ForeColor = Color.DarkGreen;
34+
}
35+
36+
private void readButton_Click(object sender, EventArgs e)
37+
{
38+
if (_stream != null){
39+
currentLineLabel.Enabled = true;
40+
textBox1.Enabled = true;
41+
42+
43+
statusLabel.Text = "Reading...";
44+
string line;
45+
while ((line = _stream.ReadLine()) != null){
46+
textBox1.Text = line;
47+
_synth.Speak(line);
48+
}
49+
statusLabel.Text = "Done";
50+
}else{
51+
statusLabel.Text = "No document loaded";
52+
}
53+
54+
_stream.Close();
55+
}
56+
57+
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
58+
{
59+
Application.Exit();
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)