Can I use a earphone (with mic) to use voice recognition feature of any AI API (like Alexa)in raspberry pi
2 Answers
Unfortunately the existing 3.5mm jack on the Pi is for audio out and not audio in. However there is a solution...
You can use a USB sound card that has the mic functionality. You can get USB sound cards that have either the 4-ring single 3.5mm jack or one with separate line-in and line-out jacks. Alternatively, you could just buy USB microphone for the audio in and use the existing jack for audio out.
For the sound card (or microphone) you choose, you should make sure that it works with the standard Linux sound drivers or else drivers have been written for that particular sound card.
In terms of voice recognition software, Google has some free APIs. Amazon offer the Alexa Voice Service. Other contenders include:
These sites discuss what voice recognition software to use and how to implement them:

- 141
- 1
- 1
- 9
-
This doesn't answer the question. – opu 웃 Nov 26 '18 at 06:00
-
1Could you please elaborate so that I can improve my answer? – sa_leinad Nov 27 '18 at 00:52
-
Looks like you've edited your answer. The first line wasn't there before I comment. – opu 웃 Nov 27 '18 at 05:46
Unfortunately, according to the documentation, you cannot:
2. WHAT ABOUT STANDARD AUDIO IN AND OUT?
There is a standard 3.5mm jack for audio out to an amplifier. You can add any supported USB microphone for audio in or, using the I2S interface, you can add a codec for additional audio I/O.
Also see

- 681
- 5
- 19
-
I don't see any mention of using the built-in jack, although it might be implied. If you added a USB sound card (they are cheap and plentiful), it should have a mic input and (presuming the device uses normal USB protocols and does not require a special driver), then it should be fine and work exactly like the built in audio. – goldilocks Oct 19 '17 at 14:47
-
2The asker definitely left a lot out. I answered the question "Can you use headphones with a mic on a raspberry pi for mic input" because answering with HAT's and other types of add ons is either too broad of an answer (requiring endless research for EXACTLY what the asker wants, which is not in the question), or too simple of an answer: "yes, with additional hardware." I assumed a valid question and maybe that was a mistake – Quintin Balsdon Oct 19 '17 at 14:54