Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,722 members, 7,955,710 topics. Date: Sunday, 22 September 2024 at 01:28 PM |
Nairaland Forum / Science/Technology / Programming / How To Code Your Own Personal Assistant In Python (5242 Views)
Teach Yourself To Code / Web Programming Tutorial In Python. / CBT In Python. V2 By Fleshbone (2) (3) (4)
(1) (Reply)
How To Code Your Own Personal Assistant In Python by Emmyirab(m): 1:32pm On Mar 03, 2016 |
In a blog post, programmer Gurwinder Gulati shared his quest to make a Python-powered personal assistant for himself in 2016. He calls his AI assistant Samwise and explains the coding process in three parts: Jarvis’s Mouth, Jarvis’s Ears, and Jarvis’s Brain. As the name suggests, Jarvis’s Mouth deals with text-to- speech conversion process. While many Python libraries are available that offer voice recognition and speech synthesis, Mr. Gulati chose to move ahead with pyttsx — an offline, free and open source resource. It’s also updated to work with Python 3. To use it, you need to install JPercent’s version of pyttsx by running the command pip install pyttsx. For Windows, you should install PyWin32 and Microsoft Speech API. For speech recognition/Jarvis’s ears, you need to use SpeechRecognition. This great resource offers the freedom to use Sphinx project to convert the audio input into a text. You can also use Google services and Wit.ai to do the same with the help of SpeechRecognition. Now that you’ve got everything you need, let’s take a look at Jarvis’s Brain which is basically the code written by Mr. Gulati. You can assemble the above-mentioned resources and libraries to create your own AI assistant. Take a look: import speech_recognition import pyttsx speech_engine = pyttsx.init( 'sapi5' speech_engine.setProperty( 'rate' , 15 def speak(text): speech_engine.say(text) speech_engine.runAndWait() recognizer = speech_recognition.Reco def listen(): with speech_recognition.Mic recognizer.adjust_ audio = recognizer try : return recognizer. # or: return recog except speech_recognition.U print( "Could not u except speech_recognition.R print( "Recog Error return "" speak( "Say something!" ) speak( "I heard you say " + listen() |
Re: How To Code Your Own Personal Assistant In Python by Nobody: 8:56pm On Mar 03, 2016 |
Gush.....i feel like giving you a hot |
Re: How To Code Your Own Personal Assistant In Python by danidee10(m): 6:56am On Mar 06, 2016 |
And you didn't even indent the code well |
(1) (Reply)
How Does It Take To Learn Python programming language Easy And Faster? / How Many Hours Should I Commit In A Day In Order To Learn Javascript In 3 Months / Be Sincere, Is Programming That Lucrative?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7 |