Home Python Speech Recognition no sound from audio interface
Reply: 0

Python Speech Recognition no sound from audio interface

user1035 Published in June 23, 2018, 5:47 pm

I've got a problem with Python (3.5.3) and using an audio interface. The following code works perfectly with the Built-in microphone

import speech_recognition as sr

for index, name in enumerate(sr.Microphone.list_microphone_names()):
    print("Microphone with name \"{1}\" found for `Microphone(device_index={0})`".format(index, name))
r = sr.Recognizer()
with sr.Microphone(device_index=4) as source:
    audio = r.record(source, duration = 5)
with open("microphone-results.wav", "wb") as f:

but as soon as I change it to

with sr.Microphone(device_index=4) as source:

there is just 5 seconds of silence. Device 4 is definitely my interface. I've even tried it with another one to make sure its not the interface that's the problem, but with the same result. The microphone I'm using is definitely working, I can record audio in Audacity without a problem.

Hope someone can help,

Thank you!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307208 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO