import speech_recognition import playsound # Initialise the recognizer. recognizer = speech_recognition.Recognizer() # Play the test clip. playsound.playsound('testing123.wav') # Use the test clip as the audio source. with speech_recognition.AudioFile('testing123.wav') as source: audio = recognizer.listen(source) # Use Google Speech Recognition and display text. text = recognizer.recognize_google(audio) print(text)