All Projects → goxr3plus → java-google-speech-api

goxr3plus / java-google-speech-api

Licence: GPL-3.0 license
🙊 Speech Recognition , Text To Speech , Google Translate

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to java-google-speech-api

MouseTooltipTranslator
chrome extension - When mouse hover on text, it shows translated tooltip using google translate
Stars: ✭ 93 (+38.81%)
Mutual labels:  text-to-speech, google-translate
android-localization-helper
A python script that helps you create strings.xml for all languages in different hierarchical folder(using Google Translation API)
Stars: ✭ 19 (-71.64%)
Mutual labels:  google-translate
po-auto-translation
translate PO files automatically for FREE using google translate
Stars: ✭ 33 (-50.75%)
Mutual labels:  google-translate
myG2P
Myanmar (Burmese) Language Grapheme to Phoneme (myG2P) Conversion Dictionary for speech recognition (ASR) and speech synthesis (TTS).
Stars: ✭ 43 (-35.82%)
Mutual labels:  text-to-speech
hawking
The retro text-to-speech bot for Discord
Stars: ✭ 24 (-64.18%)
Mutual labels:  text-to-speech
text-to-speech-sample
Python3 Text to Speech Video Sample
Stars: ✭ 87 (+29.85%)
Mutual labels:  text-to-speech
IMS-Toucan
Text-to-Speech Toolkit of the Speech and Language Technologies Group at the University of Stuttgart. Objectives of the development are simplicity, modularity, controllability and multilinguality.
Stars: ✭ 295 (+340.3%)
Mutual labels:  text-to-speech
RoboCop
Artificially Intelligent Machine with Computer Vision, Natural Language Processing, AI, Sense and Feelings.
Stars: ✭ 20 (-70.15%)
Mutual labels:  speechrecognition
node-google-translate-skidz
Simple Node.js library for talking to Google's Translate API for free.
Stars: ✭ 70 (+4.48%)
Mutual labels:  google-translate
brasiltts
Brasil TTS é um conjunto de sintetizadores de voz, em português do Brasil, que lê telas para portadores de deficiência visual. Transforma texto em áudio, permitindo que pessoas cegas ou com baixa visão tenham acesso ao conteúdo exibido na tela. Embora o principal público-alvo de sistemas de conversão texto-fala – como o Brasil TTS – seja formado…
Stars: ✭ 34 (-49.25%)
Mutual labels:  text-to-speech
routinepanic.com
🌐 协慌网 - 专注编程问答汉化。
Stars: ✭ 18 (-73.13%)
Mutual labels:  google-translate
Pyautogui-module-using-audio
📌 This repo is all about how we implemented pyttsx3,speech_recognition,colored all three modules with pyautogui module.
Stars: ✭ 25 (-62.69%)
Mutual labels:  speechrecognition
php-google-translate-for-free
Library for free use Google Translator. With attempts connecting on failure and array support.
Stars: ✭ 124 (+85.07%)
Mutual labels:  google-translate
googletrans
G文⚡️: Concurrency-safe, Free and Unlimited google translate api for Golang. 🔥免费、无限、并发安全的谷歌翻译包
Stars: ✭ 94 (+40.3%)
Mutual labels:  google-translate
soundpad-text-to-speech
Text-To-Speech for Soundpad
Stars: ✭ 29 (-56.72%)
Mutual labels:  text-to-speech
TextNormalizationCoveringGrammars
Covering grammars for English and Russian text normalization
Stars: ✭ 60 (-10.45%)
Mutual labels:  text-to-speech
mlp-singer
Official implementation of MLP Singer: Towards Rapid Parallel Korean Singing Voice Synthesis (IEEE MLSP 2021)
Stars: ✭ 103 (+53.73%)
Mutual labels:  text-to-speech
FFTNet
FFTNet: a Real-Time Speaker-Dependent Neural Vocoder
Stars: ✭ 63 (-5.97%)
Mutual labels:  text-to-speech
Expressive-FastSpeech2
PyTorch Implementation of Non-autoregressive Expressive (emotional, conversational) TTS based on FastSpeech2, supporting English, Korean, and your own languages.
Stars: ✭ 139 (+107.46%)
Mutual labels:  text-to-speech
vits
VITS: Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
Stars: ✭ 1,604 (+2294.03%)
Mutual labels:  text-to-speech

THIS LIBRARY IS NOT SUPPORTED BY ME ACTIVELY ANYMORE , feel free to contribute :)


Java Google Speech Api ( Library )

🎤

This project is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.


Latest Version GitHub contributors HitCount Total Downloads

Google has released it's official library for Google Speech Recognition . Check this issue for Official Google Speech Library code solution -> #4

Add it to your project using JitPack :

https://jitpack.io/private#goxr3plus/java-google-speech-api

Step 1. Add the JitPack repository to your build file

<repositories>
	<repository>
	   <id>jitpack.io</id>
	   <url>https://jitpack.io</url>
        </repository>
</repositories>

Step 2. Add the dependency

<dependency>
   <groupId>com.github.goxr3plus</groupId>
   <artifactId>java-google-speech-api</artifactId>
   <version>8.0.0</version> 
</dependency>

Java Google Speech API

Warning : The default secret key i was using is not working anymore (because ... i have to pay lol ) , you have to make your own , check tutorials :)

Description

This project is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.

Features

This project is separated on 3 parts :

1) Google Speech Recognition based on Chromium Speech API (which is free with restrictions for commercial applications) through GSpeechDuplex.java

 - Microphone Capture API is used (Wrapped around the current Java API for simplicity)
 - Converts WAVE files from microphone input to FLAC (using existing API, see CREDITS)
 - Retrieves Response from Google, including confidence score and text
Keep in mind that:

It doesn't currently support the new official Google Cloud Speech API(which is also free but for a certain amount of words)

Update 2/7/2018

Check this issue for Official Google Speech Library code solution -> #4

The new Google Cloud Speech API is not supported yet but you can see here the official Alpha Library from supported by Google

Create Google Cloud Account Generate Speech Recognition Private API Keys
First Second

2) Google translate full support through GoogleTranslate.java

- A translator using Google Translate (courtesy of Skylion's Google Toolkit)
Tutorial 1 Tutorial 2
First Second

3) Text to Speech , Audio Synthesizer through SynthesiserV2.java

- Retrieves synthesized text in an InputStream (MP3 data ready to be played)
Tutorial 1 Tutorial 2
First Second

The program supports dozens of languages and even has the ability to auto-detect languages!

Maven Build

Maven Clean Package [ With Javadocs produced ]

mvn clean package

Maven Clean Package [ No Javadocs produced ]

mvn -Dmaven.javadoc.skip=true clean package

Java Swing speech recognition example using GSpeechDuplex.java

package Try_Google_Speech_Recognition_Simple;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import com.darkprograms.speech.microphone.Microphone;
import com.darkprograms.speech.recognizer.GSpeechDuplex;
import com.darkprograms.speech.recognizer.GSpeechResponseListener;
import com.darkprograms.speech.recognizer.GoogleResponse;

import net.sourceforge.javaflacencoder.FLACFileWriter;

public class TryGoogleSpeechRecognitionSimple implements GSpeechResponseListener {
	
	public static void main(String[] args) throws IOException {
		final Microphone mic = new Microphone(FLACFileWriter.FLAC);
		// You have to make your own GOOGLE_API_KEY 
		GSpeechDuplex duplex = new GSpeechDuplex("GOOGLE_API_KEY");
		
		duplex.setLanguage("en");
		
		JFrame frame = new JFrame("Jarvis Speech API DEMO");
		frame.setDefaultCloseOperation(3);
		JTextArea response = new JTextArea();
		response.setEditable(false);
		response.setWrapStyleWord(true);
		response.setLineWrap(true);
		
		final JButton record = new JButton("Record");
		final JButton stop = new JButton("Stop");
		stop.setEnabled(false);
		
		record.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				new Thread(() -> {
					try {
						duplex.recognize(mic.getTargetDataLine(), mic.getAudioFormat());
					} catch (Exception ex) {
						ex.printStackTrace();
					}
					
				}).start();
				record.setEnabled(false);
				stop.setEnabled(true);
			}
		});
		stop.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				mic.close();
				duplex.stopSpeechRecognition();
				record.setEnabled(true);
				stop.setEnabled(false);
			}
		});
		JLabel infoText = new JLabel(
				"<html><div style=\"text-align: center;\">Just hit record and watch your voice be translated into text.\n<br>Only English is supported by this demo, but the full API supports dozens of languages.<center></html>",
				
				0);
		frame.getContentPane().add(infoText);
		infoText.setAlignmentX(0.5F);
		JScrollPane scroll = new JScrollPane(response);
		frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), 1));
		frame.getContentPane().add(scroll);
		JPanel recordBar = new JPanel();
		frame.getContentPane().add(recordBar);
		recordBar.setLayout(new BoxLayout(recordBar, 0));
		recordBar.add(record);
		recordBar.add(stop);
		frame.setVisible(true);
		frame.pack();
		frame.setSize(500, 500);
		frame.setLocationRelativeTo(null);
		
		duplex.addResponseListener(new GSpeechResponseListener() {
			String old_text = "";
			
			public void onResponse(GoogleResponse gr) {
				String output = "";
				output = gr.getResponse();
				if (gr.getResponse() == null) {
					this.old_text = response.getText();
					if (this.old_text.contains("(")) {
						this.old_text = this.old_text.substring(0, this.old_text.indexOf('('));
					}
					System.out.println("Paragraph Line Added");
					this.old_text = ( response.getText() + "\n" );
					this.old_text = this.old_text.replace(")", "").replace("( ", "");
					response.setText(this.old_text);
					return;
				}
				if (output.contains("(")) {
					output = output.substring(0, output.indexOf('('));
				}
				if (!gr.getOtherPossibleResponses().isEmpty()) {
					output = output + " (" + (String) gr.getOtherPossibleResponses().get(0) + ")";
				}
				System.out.println(output);
				response.setText("");
				response.append(this.old_text);
				response.append(output);
			}
		});
	}
	
	@Override
	public void onResponse(GoogleResponse paramGoogleResponse) {
		// TODO Auto-generated method stub
		
	}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].