How to automatically select a compatitable audio interface ID in the classify.py script of the python API for sound recognition?

Hello,

I want to ask is there a way to have the classify.py script in the Python SDK library that classifies sounds from an input microphone, select an available compatitable audio interface ID to use automatically,because if i set a spesific device id inside the script,when i reboot the raspberry pi the id for that audio device has changed so the script stops executing for selection of an approperiate audio device id.

Thanks for taking the time to read my question,

George

Hi @geosasa,

That is the default behavior if you don’t provide a device ID to the classify.py script. If you want a bit more control on the selected device, you can also call the listAvailableDevices() from the Microphone class in our SDK: https://github.com/edgeimpulse/linux-sdk-python/blob/master/edge_impulse_linux/audio.py#L51, and filter out the device description to select the correct ID for classification.

Let me know if that helps,
Aurelien

Thanks for the answer i will try it out and come back to you with the results,

George