speech_recognition
speech_recognition copied to clipboard
recognize_google should have pfilter = 0 by default but it's censoring words as if it's running pfilter = 1
Steps to reproduce
def speech_to_text(self):
recognizer = sr.Recognizer()
with sr.Microphone() as mic:
print("listening...")
recognizer.adjust_for_ambient_noise(mic,duration=2)
audio = recognizer.listen(mic)
try:
self.text = recognizer.recognize_google(audio, language = "en-US")
print(text)
"what the shit" "what the s***" -> This is what is recorded, and in theory the correct result of pfitler = 1, But even in the source code it looks like it's running pfilter = 0.
Expected behaviour
I would expect this to return without the censorship and if i provide pfitler = 1 then I should get the above result. Or if you are really lazy until a real fix comes out, a quick update to say the default is returning the results of pfitler = 1
System information
(Delete all the statements that don't apply.)
My system is macOS Monterey
My Python version is 3.9.12
My Pip version is 22.0.4
My SpeechRecognition library version is 3.7.1
My PyAudio library version is 0.2.11
I have this problem. Can somebody help?
if key is None: key = "AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw"
url = "http://www.google.com/speech-api/v2/recognize?{}".format(urlencode({
"client": "chromium",
"lang": language,
"key": key,
"pFilter": pfilter
}))
Looks like this is handled on the server side. This should be reported to Google.
I have just reported to Google that this repository, in my opinion, is exposing this fraudulent API key