-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0cc213
commit 2e555ac
Showing
75 changed files
with
267,529 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
</configuration> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
using System.Speech; | ||
using System.Speech.Recognition; | ||
using System.Speech.Synthesis; | ||
using System.IO; | ||
using System.Drawing.Imaging; | ||
|
||
namespace Smart_Application | ||
{ | ||
public partial class Assistant : Form | ||
{ | ||
SpeechRecognitionEngine recEngine = new SpeechRecognitionEngine(); | ||
SpeechSynthesizer speech = new SpeechSynthesizer(); | ||
System.Media.SoundPlayer music = new System.Media.SoundPlayer(); | ||
public Assistant() | ||
{ | ||
InitializeComponent(); | ||
|
||
Choices choices = new Choices(); | ||
string[] text = File.ReadAllLines(Environment.CurrentDirectory + "//grammer.txt"); | ||
choices.Add(text); | ||
Grammar grammar = new Grammar(new GrammarBuilder(choices)); | ||
recEngine.LoadGrammar(grammar); | ||
recEngine.SetInputToDefaultAudioDevice(); | ||
recEngine.RecognizeAsync(RecognizeMode.Multiple); | ||
recEngine.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(recEngine_SpeechRecognized); | ||
|
||
speech.SelectVoiceByHints(VoiceGender.Female); | ||
} | ||
|
||
private void recEngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) | ||
{ | ||
string result = e.Result.Text; | ||
|
||
if (result == "Hello Zain") | ||
{ | ||
result = "Hello, I am Zain State your Command"; | ||
} | ||
|
||
if (result == "Lights On") | ||
{ | ||
result = "Activated"; | ||
} | ||
|
||
if (result == "Refridgerator On") | ||
{ | ||
result = "Activated"; | ||
} | ||
|
||
if (result == "Air Conditioner On") | ||
{ | ||
result = "Activated"; | ||
} | ||
|
||
if (result == "Temprature On") | ||
{ | ||
result = "Activated"; | ||
} | ||
|
||
if (result == "Lights Off") | ||
{ | ||
result = "Dectivated"; | ||
} | ||
|
||
if (result == "Refridgerator Off") | ||
{ | ||
result = "Deactivated"; | ||
} | ||
|
||
if (result == "Air Conditioner Off") | ||
{ | ||
result = "Deactivated"; | ||
} | ||
|
||
if (result == "Temprature Off") | ||
{ | ||
result = "Deactivated"; | ||
} | ||
|
||
|
||
if (result == "EXIT") | ||
{ | ||
this.Hide(); | ||
} | ||
|
||
|
||
speech.SpeakAsync(result); | ||
txtlabel.Text = result; | ||
} | ||
|
||
private void Assistant_Load(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void guna2Button8_Click(object sender, EventArgs e) | ||
{ | ||
this.Hide(); | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace Smart_Application | ||
{ | ||
public partial class Login : Form | ||
{ | ||
public Login() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
|
||
private void label2_Click(object sender, EventArgs e) | ||
{ | ||
Application.Exit(); | ||
} | ||
|
||
int count = 0; | ||
private void guna2Button1_Click(object sender, EventArgs e) | ||
{ | ||
String username = TextBox1.Text; | ||
String password = TextBox2.Text; | ||
|
||
count = count + 1; | ||
|
||
if (count > 3) | ||
{ | ||
MessageBox.Show("Sorry Invalid User Attempt !!"); | ||
this.Close(); | ||
} | ||
|
||
if (username.Equals("branL") && password.Equals("2001")) | ||
{ | ||
dashboard dashboard = new dashboard(); | ||
this.Hide(); | ||
dashboard.Show(); | ||
} | ||
else | ||
{ | ||
MessageBox.Show("Username or Password Incorrect !"); | ||
} | ||
} | ||
|
||
private void TextBox2_TextChanged(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void guna2Panel2_Paint(object sender, PaintEventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void Login_Load(object sender, EventArgs e) | ||
{ | ||
Label3.Text = DateTime.Now.ToShortTimeString(); | ||
|
||
|
||
int currentHour = DateTime.Now.Hour; | ||
|
||
if (currentHour < 12) | ||
guna2HtmlLabel6.Text = "Good Morning Bran!"; | ||
else if (currentHour < 18) | ||
guna2HtmlLabel6.Text = "Good Afternoon Bran!"; | ||
else | ||
guna2HtmlLabel6.Text = "Good Evening Bran!"; | ||
} | ||
|
||
|
||
private void timer1_Tick(object sender, EventArgs e) | ||
{ | ||
Label3.Text = DateTime.Now.ToShortTimeString(); | ||
timer1.Start(); | ||
} | ||
|
||
private void guna2HtmlLabel6_Click(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.