How to use HID to get the status of the LEDs?

info about ReSpeaker series products

Moderators: lily.li, violet, seth.welday

Post Reply
michaelluk503
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Tue May 29, 2018 3:39 pm

How to use HID to get the status of the LEDs?

Post by michaelluk503 » Mon Jul 23, 2018 5:29 pm

The LED will turn on when someone speaks to it and turn off when there's no one talking. How to get the status using HID?
I would like to build a recorder that auto stop when someone stop talking.
Thanks.

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: How to use HID to get the status of the LEDs?

Post by hong.jiang » Tue Jul 24, 2018 9:46 am

Hi there, we do not have the HID demo. we have the python demo to read the VAD(Voice Activity Detection) status. http://wiki.seeedstudio.com/ReSpeaker_M ... -detection
thanks
Seeed techsupport team
Bill

michaelluk503
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Tue May 29, 2018 3:39 pm

Re: How to use HID to get the status of the LEDs?

Post by michaelluk503 » Tue Jul 24, 2018 1:45 pm

Cool, thanks.

I've tried the demo and sometime it returns false even when someone is speaking. Could you recommend which parameters should I fine-tune in tuning.py (http://wiki.seeedstudio.com/ReSpeaker_M ... .0/#tuning)?

bill.yu
Junior-7
Junior-7
Posts: 732
Joined: Mon Apr 02, 2018 11:05 am

Re: How to use HID to get the status of the LEDs?

Post by bill.yu » Mon Jul 30, 2018 10:06 am

Hi there, please fine tune time.sleep(X) in below code. thanks.

from tuning import Tuning
import usb.core
import usb.util
import time

dev = usb.core.find(idVendor=0x2886, idProduct=0x0018)
#print dev
if dev:
Mic_tuning = Tuning(dev)
print Mic_tuning.is_voice()
while True:
try:
print Mic_tuning.is_voice()
time.sleep(1)
except KeyboardInterrupt:
break

Bill

Post Reply