Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,596 members, 7,809,165 topics. Date: Friday, 26 April 2024 at 02:17 AM |
Nairaland Forum / Science/Technology / Programming / How To Code Your Own Personal Assistant In Python (5197 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)
I'm Leaving Nairaland But Not Without A Gift For ALL Programmers! / Message To Nairaland Programmers On Programming and Success / My Board Games In Vb 6.0
(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. 8 |