HACKTECH-STT 0.1__tar.gz

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,45 @@
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 os import getcwd
6
+
7
+ chrome_options = webdriver.ChromeOptions()
8
+ chrome_options.add_argument("--use-fake-ui-for-media-stream")
9
+ chrome_options.add_argument("--headless=new")
10
+
11
+ driver = webdriver.Chrome(options=chrome_options)
12
+
13
+ website = f"{getcwd()}\\index.html"
14
+
15
+ driver.get(website)
16
+
17
+ rec_file = f"{getcwd()}\\input.txt"
18
+
19
+ def listen():
20
+ try:
21
+ start_button = WebDriverWait(driver,20).until(EC.element_to_be_clickable((By.ID, 'startButton')))
22
+ start_button.click()
23
+ print("Listning...")
24
+ output_text = ""
25
+ is_second_click = False
26
+ while True:
27
+ output_element = WebDriverWait(driver,20).until(EC.presence_of_element_located((By.ID,'output')))
28
+ current_text = output_element.text.strip()
29
+ if "Start Listning" in start_button.text and is_second_click:
30
+ if output_text:
31
+ is_second_click = False
32
+ elif "listning..." in start_button.text:
33
+ is_second_click = True
34
+ if current_text != output_text:
35
+ output_text = current_text
36
+ with open(rec_file,"w") as file:
37
+ file.write(output_text.lower())
38
+ print("USER: " + output_text)
39
+ except KeyboardInterrupt:
40
+ pass
41
+ except Exception as e:
42
+ print(e)
43
+
44
+
45
+ listen()
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: HACKTECH-STT
3
+ Version: 0.1
4
+ Summary: this is speech to text package by Kirat Choudhary
5
+ Author: Kirat Choudhary
6
+ Author-email: example@gmail.com
7
+ Dynamic: author
8
+ Dynamic: author-email
9
+ Dynamic: summary
@@ -0,0 +1,6 @@
1
+ setup.py
2
+ HACKTECH_STT/__init__.py
3
+ HACKTECH_STT.egg-info/PKG-INFO
4
+ HACKTECH_STT.egg-info/SOURCES.txt
5
+ HACKTECH_STT.egg-info/dependency_links.txt
6
+ HACKTECH_STT.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ HACKTECH_STT
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: HACKTECH-STT
3
+ Version: 0.1
4
+ Summary: this is speech to text package by Kirat Choudhary
5
+ Author: Kirat Choudhary
6
+ Author-email: example@gmail.com
7
+ Dynamic: author
8
+ Dynamic: author-email
9
+ Dynamic: summary
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,24 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+
5
+ name='HACKTECH-STT',
6
+ version='0.1',
7
+ author='Kirat Choudhary',
8
+ author_email='example@gmail.com',
9
+ description='this is speech to text package by Kirat Choudhary',
10
+ include_package_data=True,
11
+ package_data={
12
+ "hacking_stt": [
13
+ "*.html",
14
+ "*.css",
15
+ "*.js",
16
+ "*.txt",
17
+ ]
18
+ },
19
+ packages = find_packages(),
20
+ install_requirements = [
21
+ 'selenium',
22
+ 'webdriver_manager'
23
+ ]
24
+ )