tejas 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.
- tejas-0.1/PKG-INFO +12 -0
- tejas-0.1/setup.cfg +4 -0
- tejas-0.1/setup.py +14 -0
- tejas-0.1/tejas/__init__.py +45 -0
- tejas-0.1/tejas.egg-info/PKG-INFO +12 -0
- tejas-0.1/tejas.egg-info/SOURCES.txt +7 -0
- tejas-0.1/tejas.egg-info/dependency_links.txt +1 -0
- tejas-0.1/tejas.egg-info/requires.txt +2 -0
- tejas-0.1/tejas.egg-info/top_level.txt +1 -0
tejas-0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tejas
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: Speech-to-text converter created by Tejas
|
|
5
|
+
Author: Tejas Misal
|
|
6
|
+
Author-email: tejasmisal32@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
|
tejas-0.1/setup.cfg
ADDED
tejas-0.1/setup.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='tejas',
|
|
5
|
+
version='0.1',
|
|
6
|
+
author='Tejas Misal',
|
|
7
|
+
author_email='tejasmisal32@gmail.com',
|
|
8
|
+
description='Speech-to-text converter created by Tejas',
|
|
9
|
+
packages=find_packages(),
|
|
10
|
+
install_requires=[
|
|
11
|
+
'selenium',
|
|
12
|
+
'webdriver_manager'
|
|
13
|
+
],
|
|
14
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import speech_recognition as sr
|
|
2
|
+
import time
|
|
3
|
+
from os import getcwd
|
|
4
|
+
|
|
5
|
+
# File paths
|
|
6
|
+
rec_file = f"{getcwd()}\\input.txt" # latest phrase only
|
|
7
|
+
memory_file = f"{getcwd()}\\memory.txt" # full history
|
|
8
|
+
|
|
9
|
+
def listen():
|
|
10
|
+
recognizer = sr.Recognizer()
|
|
11
|
+
mic = sr.Microphone()
|
|
12
|
+
|
|
13
|
+
print("Listening... (Press Ctrl+C to stop)")
|
|
14
|
+
try:
|
|
15
|
+
while True:
|
|
16
|
+
with mic as source:
|
|
17
|
+
recognizer.adjust_for_ambient_noise(source)
|
|
18
|
+
audio = recognizer.listen(source)
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
output_text = recognizer.recognize_google(audio).strip().lower()
|
|
22
|
+
|
|
23
|
+
# Save latest phrase (overwrite)
|
|
24
|
+
with open(rec_file, "w", encoding="utf-8") as file:
|
|
25
|
+
file.write(output_text)
|
|
26
|
+
|
|
27
|
+
# Save history (append)
|
|
28
|
+
with open(memory_file, "a", encoding="utf-8") as mem:
|
|
29
|
+
mem.write(output_text + "\n")
|
|
30
|
+
|
|
31
|
+
# Print to terminal
|
|
32
|
+
print(f"User: {output_text}")
|
|
33
|
+
print("Listening...")
|
|
34
|
+
|
|
35
|
+
except sr.UnknownValueError:
|
|
36
|
+
print("Could not understand audio, retrying...")
|
|
37
|
+
except sr.RequestError as e:
|
|
38
|
+
print(f"Speech recognition error: {e}")
|
|
39
|
+
|
|
40
|
+
time.sleep(1) # Throttle loop
|
|
41
|
+
|
|
42
|
+
except KeyboardInterrupt:
|
|
43
|
+
print("Stopped listening.")
|
|
44
|
+
|
|
45
|
+
listen()
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tejas
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: Speech-to-text converter created by Tejas
|
|
5
|
+
Author: Tejas Misal
|
|
6
|
+
Author-email: tejasmisal32@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
|
+
tejas
|