Awaken-publishing 0.1.0__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,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: Awaken-publishing
3
+ Version: 0.1.0
4
+ Summary: This is a speech to text by Anuj Kumar
5
+ Author: ANUJ KUMAR
6
+ Author-email: anujdrawings@gmail.com
7
+ Dynamic: author
8
+ Dynamic: author-email
9
+ Dynamic: summary
@@ -0,0 +1,5 @@
1
+ init.py,sha256=lQmgANsj65Ks-2r3fBoqcPWqRHrhQcAWEQOBOemj_wQ,2015
2
+ awaken_publishing-0.1.0.dist-info/METADATA,sha256=aQItwMlwIynF6sMHPeyu-wmENRS9EneWB7vFCWLxXeI,230
3
+ awaken_publishing-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
4
+ awaken_publishing-0.1.0.dist-info/top_level.txt,sha256=BhEcZ5fV5ZMreS0MOv3xO8kSukSvgGBYu8pHcNiRUwU,5
5
+ awaken_publishing-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ init
init.py ADDED
@@ -0,0 +1,59 @@
1
+ from selenium import webdriver
2
+ from selenium.webdriver.common.by import By
3
+ from selenium.webdriver.support.ui import WebDriverWait
4
+ from selenium.webdriver.support import expected_conditions as EC
5
+ from selenium.webdriver.chrome.service import Service
6
+ from webdriver_manager.chrome import ChromeDriverManager
7
+ from os import getcwd
8
+
9
+ chrome_options = webdriver.ChromeOptions()
10
+ chrome_options.add_argument("--use-fake-ui-for-media-stream")
11
+
12
+ driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),options=chrome_options)
13
+
14
+ website = "https://allorizenproject1.netlify.app/"
15
+
16
+ driver.get(website)
17
+
18
+ rec_file = f"{getcwd()}\\input.txt"
19
+
20
+ def listen():
21
+ try:
22
+ start_button = WebDriverWait(driver, 20).until(
23
+ EC.element_to_be_clickable((By.ID, "startButton"))
24
+ )
25
+ start_button.click()
26
+ print("listening...")
27
+
28
+ output_text = ""
29
+ is_second_click = False
30
+
31
+ while True:
32
+ start_button = WebDriverWait(driver, 20).until(
33
+ EC.element_to_be_clickable((By.ID, "startButton"))
34
+ )
35
+ output_element = WebDriverWait(driver, 20).until(
36
+ EC.presence_of_element_located((By.ID, "output"))
37
+ )
38
+ current_text = output_element.text.strip()
39
+
40
+ if "Start Listening" in start_button.text and is_second_click:
41
+ if output_text:
42
+ is_second_click = False
43
+ elif "Listening..." in start_button.text:
44
+ is_second_click = True
45
+ if current_text and current_text != output_text:
46
+ output_text = current_text
47
+ with open(rec_file, "w", encoding="utf-8") as file:
48
+ file.write(output_text.lower())
49
+ print("USER : " + output_text)
50
+ except KeyboardInterrupt:
51
+ pass
52
+ except Exception as e:
53
+ print("ERROR:", e)
54
+ input("Press Enter to exit...")
55
+
56
+ listen()
57
+
58
+
59
+