Original-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.
- original_stt-0.1/Original_STT/__init__.py +51 -0
- original_stt-0.1/Original_STT.egg-info/PKG-INFO +12 -0
- original_stt-0.1/Original_STT.egg-info/SOURCES.txt +7 -0
- original_stt-0.1/Original_STT.egg-info/dependency_links.txt +1 -0
- original_stt-0.1/Original_STT.egg-info/requires.txt +2 -0
- original_stt-0.1/Original_STT.egg-info/top_level.txt +1 -0
- original_stt-0.1/PKG-INFO +12 -0
- original_stt-0.1/setup.cfg +4 -0
- original_stt-0.1/setup.py +17 -0
|
@@ -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 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Original_STT
|
|
@@ -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,17 @@
|
|
|
1
|
+
|
|
2
|
+
from setuptools import setup, find_packages
|
|
3
|
+
|
|
4
|
+
setup(
|
|
5
|
+
name='Original_STT',
|
|
6
|
+
version='0.1',
|
|
7
|
+
author='Amaar Hussain',
|
|
8
|
+
author_email='amaarking77.712@gmail.com',
|
|
9
|
+
description='This is speech to text package created by Amaar',
|
|
10
|
+
packages=find_packages(),
|
|
11
|
+
install_requires=[
|
|
12
|
+
'selenium',
|
|
13
|
+
'webdriver-manager'
|
|
14
|
+
]
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|