Coder Social home page Coder Social logo

googlespeaks's Introduction

google-speaks

This was done six years ago, just before I entered college. Please keep that in mind.

This is a simple python module that I made for casting sentences to google home from a Raspberry Pi. It gets around pychromecast's inability to cast local files, and, when paired with other services, it allows google home to offer me information without me having to ask for said information. Likewise, it also allows me to ask for information beyond that which the Google Assistant and IFTTT allow for (that is to say, of course, a premade response), such as the connection status of my devices. Also, this is a bit of a throw-together; if you feel you can improve it let me know.

Prerequisites

Install pychromecast, gtts, and urllib3 with the following commands:

sudo pip install pychromecast
sudo pip install gtts
sudo pip install urllib3

You'll also need to run an apache server. Install apache2 with:

sudo apt-get install apache2 apache2-utils

Setup

Change "YOUR_DEVICE'S_NAME_HERE" to your device's name. Also change "192.168.0.39" in the 24th line to your RPi's (hopefully static) IP address. Next, you'll have to allow python to write to an accessible directory (/var/www/html) by executing:

sudo chmod 777 /var/www/html

If you're running this with python 2 and not python 3, you'll get an error from the zeroconf-Engine about unsupported operand type(s) for &: 'str' and 'int'. You can fix that error by executing:

sudo pip install --upgrade zeroconf==0.19.1

Usage

Import it and call upon the cast_sentence method. Example:

import googleSpeaks
googleSpeaks.cast_sentence('Hello World!')

Built With

  • pychromecast - What is used to actually cast the audio file.
  • gTTS - Google Translate-based TTS Engine
  • apache2 - What makes the audio file available for casting.

License

I don't care.

googlespeaks's People

Contributors

yishaisilver avatar

Stargazers

William Allen avatar

Watchers

 avatar PDigit 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.