0

I want to restrict my speech recognition program to be only used by one single specific microphone. How to design the module so that if that specific microphone is connected then the further execution will start, otherwise it will be terminated.

I want to do it because, we carry out speech recognition in a noisy scenario and hence use of this noise cancellation based microphone is strictly recommended, other microphone would give false recognition in noisy scenario.

The main codes are in C programming language and all together i am executing it with a shell script.

Is there anyother techniques which can be used in this case.. for example RFID? Also share your experiences.

Thank you

bsnayak
  • 58
  • 7
  • 1
    Don't take this the wrong way, but anything you do here can be trivially bypassed. I really would not bother, just try and trust your users or don't give them the program in the first place... – Vality Aug 18 '14 at 10:04
  • 1
    Hello, It is not the issue. The issue is if someone use this software without the specific noise cancellation based Microphone, it can malfunctionate. If something is false recognized in the noisy scenario, it can harm our systems. So, we want to restrict to be used with only one microphone. – bsnayak Aug 21 '14 at 08:46
  • So it does not have to be secure against a hostile user? Just more of a warning to a careless one? If this is the case please edit the question to make this clear, I may then be able to help. – Vality Aug 21 '14 at 09:02
  • Yes. It is just to avoid poor performance or any situation which can cause a failure. – bsnayak Aug 21 '14 at 10:25

1 Answers1

0

in the shell, when you run below command, it will list the connected audio devices

cat /proc/asound/cards

or

arecord -l

you can parse the output and decide, the expected micro phone is connected or not.

by the way, this is for a linux machine.

Oxi
  • 2,918
  • 17
  • 28
  • Can you show me a sample program how to interface it / parse the output and decide ?? Or any reference-- – bsnayak Aug 18 '14 at 07:49
  • Note that "audio device" here means sound card. It won't tell you which microphone is plugged into that sound card. It's extremely unlikely that the microphone hardware itself has any kind of built-in identification, and therefore extremely unlikely that you'll be able to identify your microphone and exclude other microphones. – Brendan Aug 18 '14 at 10:51
  • 1
    @Brendan All USB microphone has a inbuilt sound card, it shows when we use this command cat /proc/asound/cards Can we still use the sound card associate with that microphone? But how to interface that in programming- that i dont know.. !!! – bsnayak Aug 18 '14 at 10:58
  • A sound API such as ALSA allows you to enumerate the interfaces and choose one; other APIs probably do something similar as well. You may want to play with the command line tools and their advanced options and come up with an experiment solution (possibly using a pipe from arecord to get the audio data) as a prototype before writing your own solution. – Chris Stratton Aug 21 '14 at 20:06