Python hosting: Host, run, and code Python in the cloud!
Google has a great Speech Recognition API. This API converts spoken text (microphone) into written text (Python strings), briefly Speech to Text. You can simply speak in a microphone and Google API will translate this into written text. The API has excellent results for English language.
A speech recognition API offloads the logic, such that you can simply send a web request to the API, which then returns the text that was recognized. You can do this from Python code directly, but your script will need internet access behind the scenes.
Google Speech API v2 is limited to 50 queries per day. Make sure you have a good microphone.
Are you are looking for text to speech instead?
This is the installation guide for Ubuntu Linux. But this will probably work on other platforms is well. You will need to install a few packages: PyAudio, PortAudio and SpeechRecognition. PyAudio 0.2.9 is required and you may need to compile that manually.
git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
This program will record audio from your microphone, send it to the speech API and return a Python string.
The audio is recorded using the speech recognition module, the module will include on top of the program. Secondly we send the record speech to the Google speech recognition API which will then return the output.
r.recognize_google(audio) returns a string.