Python Forum

Full Version: Access Forbidden
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Python community,

We have been using the leading programming language for artificial intelligence, data science and entrepreneurship.

Unfortunately, some modules within the language have been updated with a forbidden error among such as for speech reorganization and file reading.

An explanation will be a great service to the community of open minded people of the computer world. We await your answer and hope to see you soon.
Please post a concrete example of runnable code throwing one of these errors. Your description of the issue is way too vague.
Thank you for the reply, don't worry, we have the code.

import math as mt
import numpy as np
import os
import random as rd
import winsound as ws
import pyaudio as pa
import speech_recognition as sr

### This has to be 3.6.5 (32-bit for pyaudio)
for index, name in enumerate(sr.Microphone.list_microphone_names()):
    print("Microphone with name \"{1}\" found for `Microphone(device_index={0})`".format(index, name))


# get audio from the microphone                                                                       
r = sr.Recognizer()
with sr.Microphone() as source:                                                                       
    print("Speak:")                                                                                   
    audio = r.listen(source)

r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")

try:
    print("You said " + r.recognize_google(audio))
except sr.UnknownValueError:
    print("Could not understand audio")
except sr.RequestError as e:
    print("Could not request results; {0}".format(e))