AlexaUsingPython - Alexa will pay attention to your order, as: Hello Alexa, play music, Hello Alexa

Overview

AlexaUsingPython

Alexa Has Only 2 Tasks to perform:

  1. Listen Alexa will pay attention to your order, as: "Hello Alexa, play music," "Hello Alexa, what's the time?" Alexa will pay attention to your order, get it, and afterward do some activity as indicated by your order.

  2. Speaking At the point when Alexa will comprehend your order after paying attention to it, it will play out some activity on it. Now let’s Implement Those Two Features: To implement these two features, we will require two Python modules:

    1. SpeechRecognition
    2. Python Text-To-Speech (pyttsx3)
  3. SpeechRecognition This Python module performs speech recognition. It helps Alexa to listen what we are saying, catch that, and act accordingly. Use the command below to install SpeechRecognition module, from your terminal: Once installed and imported, we can use it in our task.

  4. Python Text-To-Speech (pyttsx3) Text-to-Speech (TTS) module for Python works without internet or any delay. First you’ll have to install it:

Our Alexa can finally speak with the help of this module. Starting the Fun Part We’ll create three different functions and each will be responsible for a single task.

Step #1. Importing modules Let’s first import the modules:

Step #2. Initializing of modules To use them lets initialize them and make their objects:

Step #3. Create a method to convert text to speech - talk() method.

Step #4. Create a method for Speech Recognition

Step #5. Creating a method for response

Here, we need to understand a few things:

i. Fetching required part:
  Suppose you want to hear a specific song or music. You’ll speak to Alexa this way:
  Play music_name. Using this command, we will just remove the word ‘play’ and get only
  the ‘music_name’ part:

  And, then we will store that music name (without ‘Play’) in variable song.
ii) pywhatkit.playonyt():
  To use this module we have to install this module first and then import it. PyWhatKit
  has features to help us in automation. This module has a playonyt() method which we 
  will use to play the required songs directly on YouTube.
  First we’ll have to install it:

  And then import it.
iii. datetime.datetime.now():
  To use datetime Module first we have to install it and then import it. This module 
  helps us to manipulate dates and times. The method now() returns the current time, datetime 
  module is built-in Python module.
  Import it this way:

iv. wikipedia.summary():
  First we will need to install and import the Wikipedia module. This Python library makes it 
  easy to access data from Wikipedia. The summary() method gets the data from the summary 
  section of the Wikipedia.
  As we know it’s a third party module, then, we’ll have to install it first:

  And then import it in our code.
v. pyjokes.get_joke():
  First of all we have to install and import pyjokes module in order to use it in our program. This 
  module will generate some funny jokes randomly which our Alexa will crack.
  This is also a third-party module so first, we will have to install pyjokes.

  And then import it.

Step #6. Let’s run our Alexa

Finally, we make the call to the run_alexa() method.
Now we have created our own Alexa. Yay!
Using some Python skills and with the help of some other modules you can add more features to Alexa.

The Whole Code Now you can Enjoy your Alexa.

Owner
Abubakar Sattar
SEO expert and Web Developer with industry experience building websites and optimizing them for better ranking in Google. -Python -Cpp -Java -AI -ML
Abubakar Sattar
List of resources for learning Category Theory

A curated list of resources for studying category theory. As resources aimed at mathematicians are abundant, this list is aimed at materials whose target audience is not people with a graduate-level

Bruno Gavranović 100 Jan 01, 2023
Simple tooling for marking deprecated functions or classes and re-routing to the new successors' instance.

pyDeprecate Simple tooling for marking deprecated functions or classes and re-routing to the new successors' instance

Jirka Borovec 45 Nov 24, 2022
An extensive password manager built using Python, multiple implementations. Something to meet everyone's taste.

An awesome open-sourced password manager! Explore the docs » View Demo · Report Bug · Request Feature 🐍 Python Password Manager 🔐 An extensive passw

Sam R 7 Sep 28, 2021
Make creating Excel XLSX files fun again

Poi: Make creating Excel XLSX files fun again. Poi helps you write Excel sheet in a declarative way, ensuring you have a better Excel writing experien

Ryan Wang 11 Apr 01, 2022
Intelligent Systems Project In Python

Intelligent Systems Project In Python

RLLAB 3 May 16, 2022
This repository contains the code for the python introduction lab

This repository contains the code for the python introduction lab. The purpose is to have a fairly simple python assignment that introduces the basic features and tools of python

1 Jan 24, 2022
Movie recommend community

README 0. 초록 1) 목적 사용자의 Needs를 기반으로 영화를 추천해주는 커뮤니티 서비스 구현 2) p!ck 서비스란? "pick your taste!" 취향대로 영화 플레이리스트(이하 서비스 내에서의 명칭인 '바스켓'이라 함)를 만들고, 비슷한 취향을 가진

2 Dec 08, 2021
A web-based chat application that enables multiple users to interact with one another

A web-based chat application that enables multiple users to interact with one another, in the same chat room or different ones according to their choosing.

3 Apr 22, 2022
免杀shellcode加载器

bypassAV 条件触发式远控 VT 5/70 免杀国内杀软及defender、卡巴斯基等主流杀软 原理 https://pureqh.top/?p=5412 use 将shellcode填至go_shellcode_encode.py生成混淆后的base64 payload 然后将生成的payl

405 Dec 14, 2022
Audio-analytics for music-producers! Automate tedious tasks such as musical scale detection, BPM rate classification and audio file conversion.

Click here to be re-directed to the Beat Inspect Streamlit Web-App You are a music producer? Let's get in touch via LinkedIn Fundamental Analytics for

Stefan Rummer 11 Dec 27, 2022
Simple utlity for sniffing decrypted HTTP/HTTPS traffic on a jailbroken iOS device into an HAR format.

Description iOS devices contain a hidden feature for sniffing decrypted HTTP/HTTPS traffic from all processes using the CFNetwork framework into an HA

83 Dec 25, 2022
TikTok Auto Claimer Made By Aim low!#9999 Leaked By bazooka#0001

Zues Auto Claimer Leaked By bazooka#0001 put proxies in prox.txt put ssid in sid.txt put all users you want to target in user.txt for the login just t

1 Jan 14, 2022
A inspector to be able to view and edit Qt style sheet while an application is running

Qt Style Sheet Inspector An inspector widget to view and modify the style sheet of a Qt app at runtime. Usage In order to use the inspector widget on

ESSS 46 Dec 10, 2022
CRC Reverse Engineering Tool in Python

CRC Beagle CRC Beagle is a tool for reverse engineering CRCs. It is designed for commnication protocols where you often have several messages of the s

Colin O'Flynn 51 Jan 05, 2023
Semantic Data Management - Property Graphs 📈

SDM - Lab 1 @ UPC 👨🏻‍💻 Table of contents Introduction Property Graph Dataset 1. Introduction This repo is all about what we have done in SDM lab 1

Mohammad Zain Abbas 1 Mar 20, 2022
NeurIPS'19: Meta-Weight-Net: Learning an Explicit Mapping For Sample Weighting (Pytorch implementation for noisy labels).

Meta-Weight-Net NeurIPS'19: Meta-Weight-Net: Learning an Explicit Mapping For Sample Weighting (Official Pytorch implementation for noisy labels). The

243 Jan 03, 2023
The update manager for the ERA App (era.sh)

ERA Update Manager This is the official update manager used in the ERA app (see era.sh) How it works Once a new version of ERA is available, the app l

Kian Shahriyari 1 Dec 29, 2021
This Python3 script will monitor Upwork RSS feed and then email you the results.

Upwork RSS Parser This Python3 script will monitor Upwork RSS feed and then email you the results. Table of Contents General Info Technologies Used Fe

Chris 5 Nov 29, 2021
A Classroom Engagement Platform

Project Introduction This is project introduction Setup Setting up Postgres This is the most tricky part when setting up the application. You will nee

Santosh Kumar Patro 1 Nov 18, 2021
🔵Open many google dorks in a fasted way

Dorkinho 🔵 The author is not responsible for misuse of the tool, use it in good practices like Pentest and CTF OSINT challenges. Dorkinho is a script

SidHawks 2 May 02, 2022