Vrushabh-STT 0.2__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.
- vrushabh_stt-0.2/PKG-INFO +9 -0
- vrushabh_stt-0.2/Vrushabh_STT.egg-info/PKG-INFO +9 -0
- vrushabh_stt-0.2/Vrushabh_STT.egg-info/SOURCES.txt +6 -0
- vrushabh_stt-0.2/Vrushabh_STT.egg-info/dependency_links.txt +1 -0
- vrushabh_stt-0.2/Vrushabh_STT.egg-info/top_level.txt +1 -0
- vrushabh_stt-0.2/setup.cfg +4 -0
- vrushabh_stt-0.2/setup.py +16 -0
- vrushabh_stt-0.2/vrushabh_STT/__init__.py +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vrushabh_STT
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name = 'Vrushabh-STT',
|
|
5
|
+
version = '0.2',
|
|
6
|
+
author = 'Vrushabh',
|
|
7
|
+
author_email= 'vrushabhtandale7@gmail.com',
|
|
8
|
+
description = 'this is speech to text package created by vrushabh'
|
|
9
|
+
|
|
10
|
+
)
|
|
11
|
+
packages = find_packages()
|
|
12
|
+
|
|
13
|
+
install_requirement = [
|
|
14
|
+
'selenium',
|
|
15
|
+
'webdriver_manager',
|
|
16
|
+
]
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
|
|
9
|
+
# pip install webdriver-manager
|
|
10
|
+
from webdriver_manager.chrome import ChromeDriverManager
|
|
11
|
+
|
|
12
|
+
from os import getcwd
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Setting up Chrome options with specific arguments
|
|
16
|
+
chrome_options = webdriver.ChromeOptions()
|
|
17
|
+
|
|
18
|
+
chrome_options.add_argument("--use-fake-ui-for-media-stream")
|
|
19
|
+
chrome_options.add_argument("--headless=new")
|
|
20
|
+
|
|
21
|
+
# Setting up the Chrome driver with WebDriverManager and options
|
|
22
|
+
driver = webdriver.Chrome(
|
|
23
|
+
service=Service(ChromeDriverManager().install()),
|
|
24
|
+
options=chrome_options
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# Creating the URL for the website using the current working directory
|
|
28
|
+
website = "https://allorizenproject1.netlify.app/"
|
|
29
|
+
|
|
30
|
+
# Opening the website in the Chrome browser
|
|
31
|
+
driver.get(website)
|
|
32
|
+
|
|
33
|
+
rec_file = f"{getcwd()}\\input.txt"
|
|
34
|
+
|
|
35
|
+
def listen():
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
start_button = WebDriverWait(driver,20).until(
|
|
39
|
+
EC.element_to_be_clickable((By.ID,'startButton'))
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
start_button.click()
|
|
43
|
+
print("Listning...")
|
|
44
|
+
|
|
45
|
+
output_text = ""
|
|
46
|
+
is_second_click = False
|
|
47
|
+
|
|
48
|
+
while True:
|
|
49
|
+
output_element = WebDriverWait(driver,20).until(
|
|
50
|
+
EC.presence_of_element_located((By.ID,'output'))
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
current_text = output_element.text.strip()
|
|
54
|
+
if "Start Listning" in start_button.text and is_second_click:
|
|
55
|
+
if output_text:
|
|
56
|
+
is_second_click = True
|
|
57
|
+
|
|
58
|
+
elif "listning..." in start_button.text:
|
|
59
|
+
is_second_click = True
|
|
60
|
+
|
|
61
|
+
if current_text != output_text:
|
|
62
|
+
output_text = current_text
|
|
63
|
+
|
|
64
|
+
with open(rec_file,"w") as file:
|
|
65
|
+
file.write(output_text.lower())
|
|
66
|
+
|
|
67
|
+
print("USER : " + output_text)
|
|
68
|
+
|
|
69
|
+
except KeyboardInterrupt:
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
except Exception as e:
|
|
73
|
+
print(e)
|