Git Product home page Git Product logo

gosttpy's Introduction

gosttpy

###Google Speech To Text for Python

Description: Python module for speech recognition using Google's speech recognition API.

NOTES: Tested in ubuntu 13.10 with python_2.7

The official Python repository for this package can be found at: https://pypi.python.org/pypi/gosttpy/0.1.0

###Dependencies For LINUX - Please install the sox and simplejson with the following lines in your terminal:

sudo  apt-get install sox

sudo  pip install simplejson

For OSX (NOT TESTED - APPEARS TO HAVE SOME PROBLEMS) you need to install Homebrew first and then the dependencies (PIP already comes with python so you might want to test in your terminal to verify your version) otherwise if you haven't installed python yet please do with "sudo brew install python" as shown in the following lines:

sudo ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

brew install sox

brew install python

pip install simplejson

###Installation: If you have PIP installed in your computer just run

sudo pip install gosttpy

OR for manuall installation:

  1. DOWNLOAD the repository by clicking this link https://github.com/fitosegrera/gosttpy/archive/master.zip OR if you are a terminal user and have GIT installed then just go for:

     sudo git clone https://github.com/fitosegrera/gosttpy.git    
    
  2. Unzip and cd into the folder

     cd PATH/TO/FOLDER/gosttpy-master
    
  3. From within the folder, run the following command:

     sudo python setup.py install
    

###USAGE

This example recieves a voice command from the user and executes a google search... It achieves this by recording a .flac audio file and uploading it to google's speech recognition engine which converts it into readable text. The output from google is a JSON object with a list of posible interpretations/transcripts (translations from voice to text). The result of this operation becomes a google search engine query that outputs some result related to the original voice command...

The goosttPy module allows you to choose between different outputs:

  1. 'RAW' --> Google's speech API JSON object (Complete / not-parsed) just raw-data

  2. 'FIRST' --> Just the first transcripted version of your voice

  3. 'ALL' --> The list of all the transcripts returned by the google speech API

  4. 'SEARCH' --> includes the search result returned from google

     from gosttpy import gosttpy
    
     speech = gosttpy.gosttpy()
    
     #Google API key for voice recognition (Replace the string 'YOUR-GOOGLE-SPEECH-API-KEY' with
     #your google API Key. get one from: https://console.developers.google.com/
    
     apiKey = 'YOUR-GOOGLE-SPEECH-API-KEY'
    
     #returnType --> options are: 'RAW', 'FIRST', 'ALL', 'SEARCH' 
     #(PLEASE SEE THE description at the begining of this example)
    
     returnType = 'FIRST'
     returnedText = speech.voiceRecognitionAndSearch(apiKey, returnType)
     print returnedText
    

###Notes:

  • This python package uses your computer's microphone so verify its enabled.
  • Getting a google speech API key might be a little tricky but there are many tutorials out there on how to do it. Give it a try, otherwise feel free to contact me. You can find official documentation at: http://www.chromium.org/developers/how-tos/api-keys

###Resources https://github.com/gillesdemey/google-speech-v2

https://pypi.python.org/pypi/gosttpy/0.1.0

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.