-
Notifications
You must be signed in to change notification settings - Fork 0
/
assistent.js
94 lines (91 loc) · 3.35 KB
/
assistent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var recogniton = new webkitSpeechRecognition()
recogniton.onresult = function(event){
var text = event.results[0][0].transcript;
const voice = document.getElementById("my-voice");
voice.innerText=text;
read(text);
}
function read(text){
var speech = new SpeechSynthesisUtterance();
speech.text = text;
if(text =="I love you"){
speech.text="sorry i have a cute girlfriend i don't accepet your request";
}
else if(text == "hello"){
speech.text="how are you";
}
else if(text == "how are you"){
speech.text="i am fine and you";
}
else if(text == "i like you"){
speech.text="i don't like you";
}
else if(text == "what's your father name"){
speech.text="I don't have a father But the name of my developer ashikul islam ifty";
}
else if(text == "hello"){
speech.text="how are you";
}
else if(text == "what's your favourite teacher"){
speech.text="my favourite teacher is ashikul islam ifty";
}
else if(text == "what are you doing"){
speech.text="now i am sleeping don't disturb me";
}
else if(text == "Where is your home"){
speech.text="My house is inside Ashik's laptop";
}
else if(text == "who are you"){
speech.text="i am a program I was developed with JavaScript";
}
else if(text == "how old are you"){
speech.text="i am only 2 day";
}
else if(text == "what's your favourite player"){
speech.text="lionel messi is my favorite player";
}
else if(text == "what's your name"){
speech.text="my name is alexa im your assistent";
}
else if(text == "you are so cute"){
speech.text="i know that but you are so pretty";
}
else if(text == "what is your name"){
speech.text="amar nam alexa";
}
else if(text == "Tomar Naam Ki"||(text =="tumhara naam ki")){
speech.text="amar nam alexa";
}
else if(text == "are you mad"){
speech.text="tui paagol tor choddogosti paagol";
}
else if(text == "Tumi Ki Khao"){
speech.text="ami javascript code khai";
}
else if(text == "what's your favourite food"){
speech.text="I don't eat anything";
}
else if(text == "Mariya's boyfriend name" ||(text == "Mariya boyfriend name")){
speech.text="I can't say maris's boyfriend name because She has many boyfriends"
}
else if(text == "Halima boyfriend" ||(text == "Halima boyfriend name")){
speech.text="I can't say halima's boyfriend name because She has many boyfriends"
}
else if(text == "shahinoor's boyfriend name" ||(text == "shahinoor boyfriend name")){
speech.text="I can't say sahinur's boyfriend name because She has many boyfriends"
}
else if(text == "habiba's boyfriend name" ||(text == "Habiba boyfriend name")){
speech.text="I can't say habiba's boyfriend name because She has many boyfriends";
}
else if(text == "Ami tomake Bhalobashi"){
speech.text="ammar akta cute girlfriend ace i love her very much"
}
else if(text == "Aashiq girlfriend name"){
speech.text="Ashik has no girlfriend he is single now but He will not go into any relationship"
}
else{
speech.text=`i don't know ${text}`;
document.getElementById("her-voice").innerText=`i don't know ${text}`
}
window.speechSynthesis.speak(speech);
}