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
Functions to analyze Cell-ID single-cell cytometry data using python language.

PyCellID (building...) Functions to analyze Cell-ID single-cell cytometry data using python language. Dependecies for this project. attrs(=21.1.0) fo

0 Dec 22, 2021
Inspect the resources of your android projects and understand which ones are not being used and could potentially be removed.

Android Resources Checker What This program will inspect the resources of your app and help you understand which ones are not being used and could pot

Fábio Carballo 39 Feb 08, 2022
Set of tools to analyze Tinynuke samples

tinynuke-toolset You'll find in that repository a set of tools and scripts I developped to analyze Tinynuke samples. Dll extractor: script used to ext

Heat Miser 14 Aug 18, 2022
Org agenda in the console

This Python script reads an org agenda file (i.e. a regular org file with some active dates) and displays an interactive and colored year calendar with detailed information for each day when the mous

Nicolas P. Rougier 113 Jan 03, 2023
Fofa asset consolidation script

资产收集+C段整理二合一 基于fofa资产搜索引擎进行资产收集,快速检索目标条件下的IP,URL以及标题,适用于资产较多时对模糊资产的快速检索,新增C段整理功能,整理出

白泽Sec安全实验室 36 Dec 01, 2022
Dev-meme - A repository that contains memes just for people like us

A repository that contains memes just for people like us. Coders are constantly

Padmashree Jha 4 Oct 31, 2022
A small C compiler written in Python for learning purposes

A small C compiler written in Python. Generates x64 Intel-format assembly, which is then assembled and linked by nasm and ld.

Scattered Thoughts 3 Oct 22, 2021
A simple python script that print the Mandelbrot set for every power of the formal formula.

Python Mandelbrot A simple python script that print the Mandelbrot set for every power of the formal formula.

Paride Giunta 2 Apr 15, 2022
Implementation of the Folders📂 esoteric programming language, a language with no code and just folders.

Folders.py Folders is an esoteric programming language, created by Daniel Temkin in 2015, which encodes the program entirely into the directory struct

Sina Khalili 425 Dec 17, 2022
A prototype COG-based tile server for sparse Mars datasets

Mars tiler Mars Tiler is a prototype web application that serves tiles from cloud-optimized GeoTIFFs, with an emphasis on supporting planetary dataset

Daven Quinn 3 Mar 23, 2022
Python library and cli util for https://www.zerochan.net/

Zerochan Library for Zerochan.net with pics parsing and downloader included! Features CLI utility for pics downloading from zerochan.net Library for c

kiriharu 10 Oct 11, 2022
Experimental proxy for dumping the unencrypted packet data from Brawl Stars (WIP)

Brawl Stars Proxy Experimental proxy for version 39.99 of Brawl Stars. It allows you to capture the packets being sent between the Brawl Stars client

4 Oct 29, 2021
PwnDatas-DB-Project(PDDP)

PwnDatas-DB-Project PwnDatas-DB-Project(PDDP) 安裝依賴: pip3 install pymediawiki 使用: cd /opt git https://github.com/JustYoomoon/PwnDatas-DB-Project.git c

21 Jul 16, 2021
Learn Python tips, tools, and techniques in around 5 minutes each.

Python shorts Learn Python tips, tools, and techniques in around 5 minutes each. Watch on YouTube Subscribe on YouTube to keep up with all the videos.

Michael Kennedy 28 Jan 01, 2023
Sigma coding youtube - This is a collection of all the code that can be found on my YouTube channel Sigma Coding.

Sigma Coding Tutorials & Resources YouTube • Facebook Support Sigma Coding Patreon • GitHub Sponsor • Shop Amazon Table of Contents Overview Topics Re

Alex Reed 927 Jan 08, 2023
Get a list of all offline/online members in a discord server

Discord server insights Get a list of all offline/online members in a discord server. Uses Selenium to crawl invite links. Config Download Chrome driv

Prakhar Gurunani 3 Oct 21, 2022
Advanced Variable Manager {AVM} [0.8.0]

Advanced Variable Manager {AVM} [0.8.0] By Grosse pastèque#6705 WARNING : This modules need some typing modifications ! If you try to run it without t

Big watermelon 1 Dec 11, 2021
A project to explore and provide useful code for Mango Markets

🥭 Mango Explorer A project to explore and provide useful code for Mango Markets

Blockworks Foundation 160 Dec 19, 2022
AndroidEnv is a Python library that exposes an Android device as a Reinforcement Learning (RL) environment.

AndroidEnv is a Python library that exposes an Android device as a Reinforcement Learning (RL) environment.

DeepMind 814 Dec 26, 2022
Basic code and description for GoBigger challenge 2021.

GoBigger Challenge 2021 en / 中文 Challenge Description 2021.11.13 We are holding a competition —— Go-Bigger: Multi-Agent Decision Intelligence Challeng

OpenDILab 183 Dec 29, 2022