GithubHelp home page GithubHelp logo

brandonarmand / text-to-speech-to-text Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 8 KB

An occasionally maintained side project that includes many different folders containing speech-recognition, text-to-speech, and speech-to-text packages.

Python 100.00%

text-to-speech-to-text's Introduction

Text-to-Speech-With-Python

PyPI version

A basic text to speech program built with python

Requirements

pip install gTTS

Usage

Parameters:
  • text - String - Text to be spoken.
  • file - String - File to save the speech to.
  • lang - String - ISO 639-1 language code to speak in.
  • slow - Boolean - Speak slowly. Default False (Note: only two speeds are provided).
textInput(text, file, language = 'en', slow = False)
Parameters:
  • file - String - File to load the speech from.
playAudio(file)

Example

text = input('Text to Speech: ')
if text != exitCode:
	  os.system("TASKKILL /F /IM wmplayer.exe")
		textInput(text, audioFile, language)
		playAudio(audioFile)

Supported Languages

  • 'af' : 'Afrikaans'
  • 'sq' : 'Albanian'
  • 'ar' : 'Arabic'
  • 'hy' : 'Armenian'
  • 'bn' : 'Bengali'
  • 'ca' : 'Catalan'
  • 'zh' : 'Chinese'
  • 'zh-cn' : 'Chinese (Mandarin/China)'
  • 'zh-tw' : 'Chinese (Mandarin/Taiwan)'
  • 'zh-yue' : 'Chinese (Cantonese)'
  • 'hr' : 'Croatian'
  • 'cs' : 'Czech'
  • 'da' : 'Danish'
  • 'nl' : 'Dutch'
  • 'en' : 'English'
  • 'en-au' : 'English (Australia)'
  • 'en-uk' : 'English (United Kingdom)'
  • 'en-us' : 'English (United States)'
  • 'eo' : 'Esperanto'
  • 'fi' : 'Finnish'
  • 'fr' : 'French'
  • 'de' : 'German'
  • 'el' : 'Greek'
  • 'hi' : 'Hindi'
  • 'hu' : 'Hungarian'
  • 'is' : 'Icelandic'
  • 'id' : 'Indonesian'
  • 'it' : 'Italian'
  • 'ja' : 'Japanese'
  • 'km' : 'Khmer (Cambodian)'
  • 'ko' : 'Korean'
  • 'la' : 'Latin'
  • 'lv' : 'Latvian'
  • 'mk' : 'Macedonian'
  • 'no' : 'Norwegian'
  • 'pl' : 'Polish'
  • 'pt' : 'Portuguese'
  • 'ro' : 'Romanian'
  • 'ru' : 'Russian'
  • 'sr' : 'Serbian'
  • 'si' : 'Sinhala'
  • 'sk' : 'Slovak'
  • 'es' : 'Spanish'
  • 'es-es' : 'Spanish (Spain)'
  • 'es-us' : 'Spanish (United States)'
  • 'sw' : 'Swahili'
  • 'sv' : 'Swedish'
  • 'ta' : 'Tamil'
  • 'th' : 'Thai'
  • 'tr' : 'Turkish'
  • 'uk' : 'Ukrainian'
  • 'vi' : 'Vietnamese'
  • 'cy' : 'Welsh'

Speech-to-Text

A basic speech recognition program.

Requirements

pip install speechrecognition
pip install pyaudio

Example

r = sr.Recognizer()
with sr.Microphone() as source:
    r.adjust_for_ambient_noise(source)
    audio = r.listen(source)
    print(r.recognize_google(audio))

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.