Giter Site home page Giter Site logo

ai-powered-personal-assistant's Introduction

AI-Powered-Personal-Assistant

Importing Libraries: The required libraries are imported, including speech_recognition, pyttsx3, wikipedia, webbrowser, datetime, and os.

Text-to-Speech Initialization: The pyttsx3 library is initialized to create an instance of the text-to-speech engine.

speak() Function: The speak() function takes a text input and uses the text-to-speech engine to convert it into speech output.

listen() Function: The listen() function uses the speech_recognition library to listen for audio input from the user's microphone. It converts the audio into text using the Google Speech Recognition API.

run_personal_assistant() Function: The main function that handles the execution of the personal assistant. It contains a loop that continuously listens for user input.

User Commands: Inside the loop, the user's query is processed. The code checks for specific commands or keywords such as "wikipedia," "open youtube," "open google," "time," and "quit."

If the query contains "wikipedia," the code extracts the search term and uses the wikipedia library to fetch a summary of the topic and speaks it using the speak() function. If the query contains "open youtube," it opens the YouTube website using the webbrowser library. If the query contains "open google," it opens the Google website using the webbrowser library. If the query contains "time," it retrieves the current time and speaks it using the speak() function. If the query contains "quit," it breaks the loop and exits the program. If none of the specific commands are detected, the assistant responds with a default message using the speak() function.

Execution: The program runs the run_personal_assistant() function, which starts listening for user commands and responds accordingly.

ai-powered-personal-assistant's People

Contributors

kiruthika162003 avatar

Stargazers

Mithilesh G avatar SNEKA N avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.