Skip to content

Instantly share code, notes, and snippets.

@KaushikShresth07
Created December 29, 2024 11:47
Show Gist options
  • Save KaushikShresth07/9f57e037097516b613c3888c9e36e5f3 to your computer and use it in GitHub Desktop.
Save KaushikShresth07/9f57e037097516b613c3888c9e36e5f3 to your computer and use it in GitHub Desktop.
HtmlCode = '''<!DOCTYPE html>
<html lang="en">
<head>
<title>Speech Recognition</title>
</head>
<body>
<button id="start" onclick="startRecognition()">Start Recognition</button>
<button id="end" onclick="stopRecognition()">Stop Recognition</button>
<p id="output"></p>
<script>
const output = document.getElementById('output');
let recognition;
function startRecognition() {
recognition = new webkitSpeechRecognition() || new SpeechRecognition();
recognition.lang = '';
recognition.continuous = true;
recognition.onresult = function(event) {
const transcript = event.results[event.results.length - 1][0].transcript;
output.textContent += transcript;
};
recognition.onend = function() {
recognition.start();
};
recognition.start();
}
function stopRecognition() {
recognition.stop();
output.innerHTML = "";
}
</script>
</body>
</html>'''
@abidora999
Copy link

Nice

@harrybhaithug777
Copy link

Thanks Bro

@codexYashSharma
Copy link

I phase this problem out please can you tell me what the main problem is here ?

File "/Users/yashsharma/sico_ai/Backend/SpeechToText.py", line 141, in
Text = SpeechRecognition()
File "/Users/yashsharma/sico_ai/Backend/SpeechToText.py", line 115, in SpeechRecognition
driver.find_element(by=By.ID, value="start").click()
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 898, in find_element
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="start"]"}
(Session info: chrome=134.0.6998.166); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
0 chromedriver 0x00000001032b76c8 cxxbridge1$str$ptr + 2791212
1 chromedriver 0x00000001032afc9c cxxbridge1$str$ptr + 2759936
2 chromedriver 0x0000000102e01e30 cxxbridge1$string$len + 92928
3 chromedriver 0x0000000102e49170 cxxbridge1$string$len + 384576
4 chromedriver 0x0000000102e8a5f8 cxxbridge1$string$len + 651976
5 chromedriver 0x0000000102e3d2fc cxxbridge1$string$len + 335820
6 chromedriver 0x000000010327c6c4 cxxbridge1$str$ptr + 2549544
7 chromedriver 0x000000010327f988 cxxbridge1$str$ptr + 2562540
8 chromedriver 0x000000010325c71c cxxbridge1$str$ptr + 2418560
9 chromedriver 0x00000001032801e8 cxxbridge1$str$ptr + 2564684
10 chromedriver 0x000000010324d750 cxxbridge1$str$ptr + 2357172
11 chromedriver 0x000000010329ff58 cxxbridge1$str$ptr + 2695100
12 chromedriver 0x00000001032a00e0 cxxbridge1$str$ptr + 2695492
13 chromedriver 0x00000001032af910 cxxbridge1$str$ptr + 2759028
14 libsystem_pthread.dylib 0x000000018e02c2e4 _pthread_start + 136
15 libsystem_pthread.dylib 0x000000018e0270fc thread_start + 8
Screenshot 2025-03-27 at 3 14 14 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment