realpython / python-speech-recognition Goto Github PK
View Code? Open in Web Editor NEWSpeech Recognition with Python examples
Home Page: https://realpython.com/python-speech-recognition/
License: MIT License
Speech Recognition with Python examples
Home Page: https://realpython.com/python-speech-recognition/
License: MIT License
I got a new GCP API key, and I tried to use it but I keep getting broken connection:
Traceback (most recent call last): File "main.py", line 13, in <module> speech=r.recognize_google(audio,key='A...........8g') File "/home/davy/anaconda3/lib/python3.6/site-packages/speech_recognition/__init__.py", line 845, in recognize_google raise RequestError("recognition connection failed: {}".format(e.reason)) speech_recognition.RequestError: recognition connection failed: [Errno 32] Broken pipe
I don't really understand why that is. I noticed that in the init.py file the key is set as follows:
if key is None: key = "AIz...bla...bla..bla...gw" url = "http://www.google.com/speech-api/v2/recognize?{}".format(urlencode({ "client": "chromium", "lang": language, "key": key, }))
Do i need to change the client? but it is just an API key client shouldn't matter right?
Contact:
Nissim Zur [email protected]
Skype: nissim.test
hi
i modifed your code a bit to read from sample file. My sample file is 55 seconds long and I noticed that it get's cut off.
I am using recognize_google.
I am guessing this is some sort of api limitation and that I should probably get my own key.
"Caution: The default key provided by SpeechRecognition is for testing purposes only, and Google may revoke it at any time. It is not a good idea to use the Google Web Speech API in production. Even with a valid API key, you’ll be limited to only 50 requests per day, and there is no way to raise this quota. Fortunately, SpeechRecognition’s interface is nearly identical for each API, so what you learn today will be easy to translate to a real-world project."
Sir, since the Google Web Speech API cannot be used in production, what is the alternative for it? I mean how can I use the speech recognition then?
`
'''This code is not giving error but i dont know why the "comp" value is always none. its not changing even through random module and its functions . please help me
'''
import random
def game(comp , player):
if player == comp:
return None
elif comp == "r":
if player == "s":
return False
elif player == "p":
return True
elif comp == "s":
if player == "p":
return False
elif player == "r":
return True
elif comp == "p":
if player == "r":
return False
elif player == "s":
return True
comp = print("Comp Turn: Rock , Papers, Scissors: ")
randNo = random.randint(1 , 3)
if randNo == 1:
comp == "r"
elif randNo == 2:
comp == "p"
elif randNo == 3:
comp == "s"
player = input("Your Turn: Rock(r) , Papers(p) , Scissors(s) : ")
result = game( comp , player)
print("Computer chose" , comp)
print("You chose`" , player)
if result == None:
print("The game is tied")
elif result:
print("You Won")
else:
print("You Lose")
'''
the "comp" value is showing none type, i want it to be str. i tried converting it but it not worked plzzz help masters. anyone professional here to help`'''
Am getting this error when am trying to access my microphone!
Am on Ubuntu dist!
I can't to open *.wav file, Please check
I am unable to open these .wav files on multiple PCs, trying multiple Music players, e.g. VLC Media Player, Groove Music, Windows Media Player, ITunes, and following your speech recognition article for python.
Can you provide files that can be used on MS Windows out of the box?
Here is the Groove Music error message:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.