netHighTech-STT 1.0.5__py3-none-any.whl → 1.0.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,35 +5,70 @@ from selenium.webdriver.common.by import By
5
5
  from selenium.webdriver.chrome.service import Service
6
6
  from webdriver_manager.chrome import ChromeDriverManager
7
7
 
8
- # Dynamic Path nikalne ke liye
9
8
  BASE_DIR = os.path.dirname(os.path.abspath(__file__))
10
9
 
11
10
  def listen():
12
11
  chrome_options = webdriver.ChromeOptions()
13
12
  chrome_options.add_argument("--use-fake-ui-for-media-stream")
14
- # Shuru mein headless OFF rakho taake error dikhay
15
- chrome_options.add_argument("--headless=new")
16
-
17
- driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
18
-
19
- # Path ko join karne ka sahi tarika
13
+ # HEADLESS OFF
14
+ # chrome_options.add_argument("--headless=new")
15
+
16
+ driver = webdriver.Chrome(
17
+ service=Service(ChromeDriverManager().install()),
18
+ options=chrome_options
19
+ )
20
+
21
+ html_path = f"file:///{os.path.join(BASE_DIR, 'index.html')}"
22
+ driver.get(html_path)
23
+
24
+ driver.find_element(By.ID, 'start-btn').click()
25
+ print("🎤 Jarvis is Listening...")
26
+
27
+ while True:
28
+ output = driver.find_element(By.ID, 'result').text.strip()
29
+
30
+ if len(output) > 1:
31
+ print("Heard:", output)
32
+ driver.execute_script(
33
+ "document.getElementById('result').textContent = '';"
34
+ )
35
+ return output # 🔥🔥 MOST IMPORTANT LINE 🔥🔥
36
+
37
+ time.sleep(0.3)
38
+ import time
39
+ import os
40
+ from selenium import webdriver
41
+ from selenium.webdriver.common.by import By
42
+ from selenium.webdriver.chrome.service import Service
43
+ from webdriver_manager.chrome import ChromeDriverManager
44
+
45
+ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
46
+
47
+ def listen():
48
+ chrome_options = webdriver.ChromeOptions()
49
+ chrome_options.add_argument("--use-fake-ui-for-media-stream")
50
+ # ❌ HEADLESS OFF
51
+ chrome_options.add_argument("--headless=new")
52
+
53
+ driver = webdriver.Chrome(
54
+ service=Service(ChromeDriverManager().install()),
55
+ options=chrome_options
56
+ )
57
+
20
58
  html_path = f"file:///{os.path.join(BASE_DIR, 'index.html')}"
21
- input_path = os.path.join(BASE_DIR, "input.txt")
22
-
23
59
  driver.get(html_path)
24
-
25
- try:
26
- # Start button click
27
- driver.find_element(By.ID, 'start-btn').click()
28
- print("Jarvis is Listening...")
29
-
30
- while True:
31
- output = driver.find_element(By.ID, 'result').text.strip()
32
- if len(output) > 1:
33
- with open(input_path, 'w', encoding='utf-8') as f:
34
- f.write(output)
35
- print("Heard:", output)
36
- driver.execute_script("document.getElementById('result').textContent = '';")
37
- time.sleep(0.5)
38
- except Exception as e:
39
- print(f"Error: {e}")
60
+
61
+ driver.find_element(By.ID, 'start-btn').click()
62
+ print("🎤 Jarvis is Listening...")
63
+
64
+ while True:
65
+ output = driver.find_element(By.ID, 'result').text.strip()
66
+
67
+ if len(output) > 1:
68
+ print("Heard:", output)
69
+ driver.execute_script(
70
+ "document.getElementById('result').textContent = '';"
71
+ )
72
+ return output # 🔥🔥 MOST IMPORTANT LINE 🔥🔥
73
+
74
+ time.sleep(0.3)
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>netHighTech AI Voice</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <h1>netHighTech Listening</h1>
12
+ <button id="start-btn">Start Recognition</button>
13
+ <div id="result"></div>
14
+ </div>
15
+ <script src="script.js"></script>
16
+ </body>
17
+ </html>
@@ -0,0 +1 @@
1
+ are you listening
@@ -0,0 +1,32 @@
1
+ const output = document.getElementById('result');
2
+ const startBtn = document.getElementById('start-btn');
3
+
4
+ const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
5
+
6
+ if (SpeechRecognition) {
7
+ const recognition = new SpeechRecognition();
8
+ recognition.interimResults = false;
9
+ recognition.lang = 'en-US';
10
+ recognition.continuous = true;
11
+
12
+ recognition.onresult = (event) => {
13
+ let transcript = "";
14
+ for (let i = event.resultIndex; i < event.results.length; ++i) {
15
+ transcript += event.results[i][0].transcript;
16
+ }
17
+ output.textContent = transcript.trim();
18
+ };
19
+
20
+ startBtn.addEventListener('click', () => {
21
+ output.textContent = '';
22
+ recognition.start();
23
+ startBtn.textContent = 'Active...';
24
+ });
25
+
26
+ recognition.onend = () => {
27
+ recognition.start(); // Loop listening
28
+ };
29
+
30
+ } else {
31
+ alert("Browser not supported!");
32
+ }
@@ -0,0 +1,31 @@
1
+ body {
2
+ background-color: #000;
3
+ color: #00ffcc;
4
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
5
+ text-align: center;
6
+ padding-top: 50px;
7
+ }
8
+ .container {
9
+ border: 2px solid #00ffcc;
10
+ display: inline-block;
11
+ padding: 30px;
12
+ border-radius: 15px;
13
+ box-shadow: 0 0 20px #00ffcc;
14
+ }
15
+ #result {
16
+ margin-top: 20px;
17
+ font-size: 1.5rem;
18
+ min-height: 50px;
19
+ }
20
+ button {
21
+ background: transparent;
22
+ color: #00ffcc;
23
+ border: 1px solid #00ffcc;
24
+ padding: 10px 20px;
25
+ cursor: pointer;
26
+ border-radius: 5px;
27
+ }
28
+ button:hover {
29
+ background: #00ffcc;
30
+ color: #000;
31
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netHighTech_STT
3
- Version: 1.0.5
3
+ Version: 1.0.9
4
4
  Summary: Speech recognition Jarvis package
5
5
  Author: Zubair Khan
6
6
  Author-email: zubairdev00@gmail.com
@@ -0,0 +1,9 @@
1
+ netHighTech_STT/__init__.py,sha256=P4Q6Gpy0vM-WQplME75S4Xm37Ag83qYgMlmMKhIAi-I,2354
2
+ netHighTech_STT/index.html,sha256=1GDTB2N4075zRMO45tbOFePGQTurIL_N81gzWuJ-ZfM,480
3
+ netHighTech_STT/input.txt,sha256=VIiBlZdsasl3vJI2Zb6WJTQjh5kW_6WTdlxl5oHRwYk,17
4
+ netHighTech_STT/script.js,sha256=0gJFL9wolkVNw5wXn26qje4Me5Zj4BkQshKvbtBNWWQ,974
5
+ netHighTech_STT/style.css,sha256=essXNq22m4xMsMfBje0hAsobZVZJGXTynoA6AqC0eRU,648
6
+ nethightech_stt-1.0.9.dist-info/METADATA,sha256=9tC8Da_gR7991jDwdqSkmvMm5qQX_u_EgXapLgnP9fE,305
7
+ nethightech_stt-1.0.9.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
8
+ nethightech_stt-1.0.9.dist-info/top_level.txt,sha256=R7VX40ODE5BrA2yz1HGB_zHPVlqoSGCK144TF29SPIw,16
9
+ nethightech_stt-1.0.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,5 +0,0 @@
1
- netHighTech_STT/__init__.py,sha256=up1sJm88atcCaNREE70Glpfk_pj1KSrYOZlKCqE3348,1462
2
- nethightech_stt-1.0.5.dist-info/METADATA,sha256=8m3s9clKgWyWjbvx0Fh0VNjbK7lCc_iGLJyp_iz760k,305
3
- nethightech_stt-1.0.5.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
4
- nethightech_stt-1.0.5.dist-info/top_level.txt,sha256=R7VX40ODE5BrA2yz1HGB_zHPVlqoSGCK144TF29SPIw,16
5
- nethightech_stt-1.0.5.dist-info/RECORD,,