netHighTech-STT 1.0.8__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.
- netHighTech_STT/__init__.py +60 -25
- {nethightech_stt-1.0.8.dist-info → nethightech_stt-1.0.9.dist-info}/METADATA +1 -1
- nethightech_stt-1.0.9.dist-info/RECORD +9 -0
- {nethightech_stt-1.0.8.dist-info → nethightech_stt-1.0.9.dist-info}/WHEEL +1 -1
- nethightech_stt-1.0.8.dist-info/RECORD +0 -9
- {nethightech_stt-1.0.8.dist-info → nethightech_stt-1.0.9.dist-info}/top_level.txt +0 -0
netHighTech_STT/__init__.py
CHANGED
|
@@ -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
|
-
#
|
|
15
|
-
chrome_options.add_argument("--headless=new")
|
|
16
|
-
|
|
17
|
-
driver = webdriver.Chrome(
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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,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,9 +0,0 @@
|
|
|
1
|
-
netHighTech_STT/__init__.py,sha256=up1sJm88atcCaNREE70Glpfk_pj1KSrYOZlKCqE3348,1462
|
|
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.8.dist-info/METADATA,sha256=dyMVXq_WJThBIEqbGskwai_Y92GLsxOF51pkVbCOHys,305
|
|
7
|
-
nethightech_stt-1.0.8.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
8
|
-
nethightech_stt-1.0.8.dist-info/top_level.txt,sha256=R7VX40ODE5BrA2yz1HGB_zHPVlqoSGCK144TF29SPIw,16
|
|
9
|
-
nethightech_stt-1.0.8.dist-info/RECORD,,
|
|
File without changes
|