Original-STT 0.1__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.
@@ -0,0 +1,51 @@
1
+ #pip install selenium
2
+
3
+ from selenium import webdriver
4
+ from selenium.webdriver.common.by import By
5
+ from selenium.webdriver.support.ui import WebDriverWait
6
+ from selenium.webdriver.support import expected_conditions as EC
7
+ from selenium.webdriver.chrome.service import Service
8
+ #pip install webdriver-manager
9
+ from webdriver_manager.chrome import ChromeDriverManager
10
+ from os import getcwd
11
+
12
+ chrome_options = webdriver.ChromeOptions()
13
+ chrome_options.add_argument("--use-fake-ui-for-media-stream")
14
+ chrome_options.add_argument("--headless=new")
15
+
16
+ driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),options=chrome_options)
17
+
18
+ website = f"{getcwd()}\\index.html"
19
+
20
+ driver.get(website)
21
+
22
+ rec_file = f"{getcwd()}\\input.txt"
23
+
24
+ def listen():
25
+ try:
26
+ start_button = WebDriverWait(driver,20).until(EC.element_to_be_clickable((By.ID,'startButton')))
27
+ start_button.click()
28
+ print("Listening...")
29
+ output_text = ""
30
+ is_second_click = False
31
+ while True:
32
+ output_element = WebDriverWait(driver,20).until(EC.presence_of_element_located((By.ID,'output')))
33
+ current_text = output_element.text.strip()
34
+ if "Start listening" in start_button.text and is_second_click:
35
+ if output_text:
36
+ is_second_click = True
37
+ elif "listening..." in start_button.text:
38
+ is_second_click = False
39
+
40
+ if current_text != output_text:
41
+ output_text = current_text
42
+ with open(rec_file, "w") as file:
43
+ file.write(output_text.lower())
44
+ print("Amaar :", output_text)
45
+ except KeyboardInterrupt:
46
+ pass
47
+ except Exception as e:
48
+ print(e)
49
+
50
+
51
+ listen()
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: Original_STT
3
+ Version: 0.1
4
+ Summary: This is speech to text package created by Amaar
5
+ Author: Amaar Hussain
6
+ Author-email: amaarking77.712@gmail.com
7
+ Requires-Dist: selenium
8
+ Requires-Dist: webdriver-manager
9
+ Dynamic: author
10
+ Dynamic: author-email
11
+ Dynamic: requires-dist
12
+ Dynamic: summary
@@ -0,0 +1,5 @@
1
+ Original_STT/__init__.py,sha256=4HTwiV_grR8RqYd6KR3TnRUbW14cUaye_GMwA0AReP0,1829
2
+ original_stt-0.1.dist-info/METADATA,sha256=g-Jx2bIG_OyD4ch2vS2l49kBANExPazGPYQa8wPQWuo,320
3
+ original_stt-0.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
4
+ original_stt-0.1.dist-info/top_level.txt,sha256=nAhkxpWNAPUuBGuPBESALALIsF1rfG0Qmg-TtJWkvkA,13
5
+ original_stt-0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ Original_STT