Abhinash-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.
- abhinash_stt-0.1/Abhinash_STT.egg-info/PKG-INFO +9 -0
- abhinash_stt-0.1/Abhinash_STT.egg-info/SOURCES.txt +6 -0
- abhinash_stt-0.1/Abhinash_STT.egg-info/dependency_links.txt +1 -0
- abhinash_stt-0.1/Abhinash_STT.egg-info/top_level.txt +1 -0
- abhinash_stt-0.1/PKG-INFO +9 -0
- abhinash_stt-0.1/STT/__init__.py +56 -0
- abhinash_stt-0.1/setup.cfg +4 -0
- abhinash_stt-0.1/setup.py +15 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Abhinash-STT
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: This is a speech to text package created by Abhinash Anil Kumar.
|
|
5
|
+
Author: Abhinash Anil Kumar
|
|
6
|
+
Author-email: abhinashanilkumar0@gmail.com
|
|
7
|
+
Dynamic: author
|
|
8
|
+
Dynamic: author-email
|
|
9
|
+
Dynamic: summary
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
STT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Abhinash-STT
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: This is a speech to text package created by Abhinash Anil Kumar.
|
|
5
|
+
Author: Abhinash Anil Kumar
|
|
6
|
+
Author-email: abhinashanilkumar0@gmail.com
|
|
7
|
+
Dynamic: author
|
|
8
|
+
Dynamic: author-email
|
|
9
|
+
Dynamic: summary
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
#Setting up the Chrome WebDriver with options to run in headless mode and allow media stream access.
|
|
13
|
+
chrome_options = webdriver.ChromeOptions()
|
|
14
|
+
chrome_options.add_argument("--use-fake-ui-for-media-stream") # Run in headless mode (no GUI)
|
|
15
|
+
chrome_options.add_argument("--headless=new")
|
|
16
|
+
|
|
17
|
+
#Setting up chrome driver with WebDriverManagaer and options
|
|
18
|
+
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
|
|
19
|
+
|
|
20
|
+
#Creating the URL for the website using the current working directory
|
|
21
|
+
website = "https://allorizenproject1.netlify.app/"
|
|
22
|
+
|
|
23
|
+
driver.get(website)
|
|
24
|
+
rec_file = f"{getcwd()}\\input.txt"
|
|
25
|
+
|
|
26
|
+
def listen():
|
|
27
|
+
try:
|
|
28
|
+
# Wait for the "Start Listening" button to be clickable and click it
|
|
29
|
+
start_button = WebDriverWait(driver, 20).until(
|
|
30
|
+
EC.element_to_be_clickable((By.ID, "startButton"))
|
|
31
|
+
)
|
|
32
|
+
start_button.click()
|
|
33
|
+
print("Listening...")
|
|
34
|
+
output_text = ""
|
|
35
|
+
is_second_click = False
|
|
36
|
+
while True:
|
|
37
|
+
output_element = WebDriverWait(driver, 20).until(
|
|
38
|
+
EC.presence_of_element_located((By.ID, 'output')))
|
|
39
|
+
current_text = output_element.text.strip()
|
|
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 != output_text:
|
|
46
|
+
output_text = current_text
|
|
47
|
+
with open(rec_file, 'w') as f:
|
|
48
|
+
f.write(output_text.lower())
|
|
49
|
+
print("USER: " + output_text)
|
|
50
|
+
|
|
51
|
+
except KeyboardInterrupt:
|
|
52
|
+
pass
|
|
53
|
+
except Exception as e:
|
|
54
|
+
print(f"An error occurred: {e}")
|
|
55
|
+
|
|
56
|
+
listen()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from setuptools import setup,find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name ='Abhinash-STT',
|
|
5
|
+
version ='0.1',
|
|
6
|
+
author ='Abhinash Anil Kumar',
|
|
7
|
+
author_email ='abhinashanilkumar0@gmail.com',
|
|
8
|
+
description ='This is a speech to text package created by Abhinash Anil Kumar.',
|
|
9
|
+
|
|
10
|
+
packages = find_packages(),
|
|
11
|
+
install_requirements = [
|
|
12
|
+
'selenium',
|
|
13
|
+
'webdriver-manager',
|
|
14
|
+
]
|
|
15
|
+
)
|