1

I want to use the microphone in my logitech c525 webcamera for speech recognition, on my jetson nano. I can detect the microphone and seems to work in the sound app. But im not able to find it when using python code. I have tried gstreamer, this just made a mp4 file with a high pitch noice that lasted longer than i recorded for. I have also tried speech_recognition module, with pyaudio. Where speech_recognition.Microphone() should connect to the microphone input, here i get no response.

Any inputs or tips would be much appreciated

vegiv
  • 124
  • 1
  • 9

1 Answers1

0

As recommended in documentation you need to list microphone names first to figure out which microphone is mapped to your USB one:

>>> sr.Microphone.list_microphone_names()
['HDA Intel PCH: ALC272 Analog (hw:0,0)',
 'HDA Intel PCH: HDMI 0 (hw:0,3)',
 'sysdefault',
 'front',
 'surround40',
 'surround51',
 'surround71',
 'hdmi',
 'pulse',
 'dmix', 
 'default']

Once you know the device index you can select it in pyaudio

>>> # This is just an example; do not run
>>> mic = sr.Microphone(device_index=3)

See also here.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • Hi @Nikolay, Thank you for answer. I already knew the device index for the microphone. But still using ` r = sr.Recognizer() with sr.Microphone(device_index=11) as source: audio = r.listen try: print(r.recognize_google(audio) except: #some error handling ` Doesent seem to do anything. It doesnt finish or anything it just runs until i force stop it. And vosk is not supported on the jetson nano it seems. – vegiv Jul 27 '20 at 10:33