speech_recognition icon indicating copy to clipboard operation
speech_recognition copied to clipboard

Wasapi Recognition

Open GBDBEN1 opened this issue 6 years ago • 1 comments
trafficstars

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)

GBDBEN1 avatar Mar 13 '19 18:03 GBDBEN1

Did you find any solution to this?

SLAYER-CODE avatar Nov 24 '21 19:11 SLAYER-CODE