Uberi / speech_recognition

Speech recognition module for Python, supporting several engines and APIs, online and offline.
https://pypi.python.org/pypi/SpeechRecognition/
BSD 3-Clause "New" or "Revised" License
8.3k stars 2.39k forks source link

Wasapi Recognition #407

Open GBDBEN1 opened 5 years ago

GBDBEN1 commented 5 years ago

I have been working on a project which includes the use of Windows WASAPI. Which enables python scripts to record the system audio on a device. I'm using soundcard python library to record the system audio which returns with an array. After creating an AudioData object it returns with unable to recognise speech. Even with the clearest recording of for eg. podcasts. please find the relevant code below:

import speech_recognition as sr
import numpy as np
import soundcard as sc
mics = sc.all_microphones(include_loopback=True)
def_mic = mics[0]
data = def_mic.record(samplerate=48000, numframes=480000,channels=1)
recognizer = sr.Recognizer()
audio = sr.AudioData(data,48000,1)
response["transcription"] = recognizer.recognize_google(audio)
SLAYER-CODE commented 2 years ago

Did you find any solution to this?