Coders Packet

AI Smart Voice Assistant for our own Device Using Speech Recognition Python Library

By VARUN SIMHA REDDY

A smart voice assistant can perform tasks or services, or answer questions used to carry out tasks via voice recognition.

OVERVIEW

Voice control accesses us to interact with our smart assistant, without lifting our single finger. Whether controlling the high smart technology or looking for the cloud through the internet to find the information we are looking for, this handy feature makes our routine life simpler and much more efficient. One of the main use for a smart assistant is to get instant answers to the questions we may have, to find the required information,  we need internet with the assistant searching. If we need to do a phone call but do not have free hands? Simply activate the assistant and, provided you have given it access to your contacts book, you can have placed a call for you.

Project description

pyttsx3

  • pyttsx3 is a python library which uses to convert text-to-speech. Unlike the alternative libraries, this works offline as well and is very compatible with both the Python version 2 and 3

    • Installation

      pip install pyttsx3

      If you get the errors such as no module named win32 client, No module type win32, or No module named win32api, you will need to additionally install the library pypiwin32.

    • Usage :

      import pyttsx3
      engine = pyttsx3.init()
      engine.say("I will speak this text")
      engine.runAndWait()

speech_recognition

With support for several engines and APIs, both online and offline 8 libraries will be used for performing speech recognition.

  • Installation

    pip install SpeechRecognition

  • Usage :

    import speech_recognition as sr
    engine = pyttsx3.init('sapi5')
    voices = engine.getProperty('voices')
    engine.setProperty('voice', voices[0].id)
    Recognize speech as an input from the microphone

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by VARUN SIMHA REDDY (VARUNREDDY099)

Download packets of source code on Coders Packet