Is there any plugin or library for Unity to do voice/speech recognition? Many thanks~
You know, in some forums I’ve participated in, telling someone to “just google it” is a ban-able offense.
If you don’t know the answer, maybe you should avoid the thread entirely?
Sorry my bad, I guess its not my day… I just got a littly cracky this morning about these topics. Still, there’s also a thing called google first and then ask on the forum
If you google that you can see that there are several topics about the same question so there should be an answer on this question… If I ask a question I can guarantee you that I’ve been on every topic/question/link I could find on google about the problem I have… It would be better if the question was something like:
"Hey guys, I’ve been looking on the internet for hours but I can’t find an answer that satisfies my needs. I found this, this and this info but no-one has ever posted a real answer on that so I thought I give it another shot… "
Or he could already have found his answer. But again, sorry, I should not have done that, I’ll just keep my mouth shut with such questions in future
Maybe it’s not what you are looking for, but if you are planning to use a webplayer with your project, you could try using the html5 Google Chrome voice recognition.
Just make a text input and enable speech recognition. Then grab the text and use it in Unity.
I would like to create a game in exe format, not for webplayer. Maybe for mobile also. Is there any good solution for that?
If you want to create an .apk for Android, there must be a way to do it. I’ve made some projects for Android and I’ve used Speech Recognition. The thing is that I don’t know if you can use this API in Unity.
And for Windows… no idea.
I googled “voice recognition in unity”, found this thread, found a link to the “let me google that for you” thing. Now I’m stuck in an infinite loop. Thanks a lot
If somebody is still interested, I could add some words into the thread.
I am currently working on the project where I’m trying to use Google Voice API as a voice recognition service. Implementation is fairly simple using some external modules.
A sequence is as following: record and save wav → convert wav to flac → send flac to Google → parse JSON response. In Unity on Windo$e I’m at last step now - having some issues with parsing JSON. The rest of the process is quite ok, except it does not work as exe or apk lol (there is a problem with the Cuetools lib).
Here is code that makes a request and gets a response:
filepath = SavWav.Save("recording", _goAudioSource.clip); //save file from recording using SavWav lib
const string flacName = "tmpFlac";
int sampleRate = SoundTools.Wav2Flac(filepath, flacName); //get sample rate from SoundTools lib
private IEnumerator WwwGoogleSpeechRequest(String flacName, int sampleRate)
{
const string url = "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium〈=ru-RU";
Debug.Log("Entering request method");
byte[] postData = File.ReadAllBytes(flacName);
Debug.Log("Read flac file. Size: " + postData.Length + " bytes");
//set up POST request parameters
var form = new WWWForm();
var headers = form.headers;
headers["Method"] = "POST";
headers["Content-Type"] = "audio/x-flac; rate=" + sampleRate;
headers["Content-Length"] = postData.Length;
headers["Accept"] = "application/json";
form.AddBinaryData("fileUpload", postData, "flacFile", "audio/x-flac; rate=" + sampleRate);
var httpRequest = new WWW(url, form.data, headers);
yield return httpRequest;
if (httpRequest.isDone string.IsNullOrEmpty(httpRequest.error))
{
//_response = String.Format("Request succeeded. Request data: {0}{1}", Environment.NewLine, httpRequest.text);
_response = httpRequest.text.Substring(1);
Debug.Log(_response);
_response = ParseResponse(_response);
Debug.Log("Request succeeded. Request data: " + _response);
}
else
{
_response = String.Format("Request failed with Error: {0}{1}", Environment.NewLine, httpRequest.error);
Debug.Log(String.Format("Request failed with Error: {0}", httpRequest.error));
}
}
It works when I click Play in Unity, however there are still many bugs all over the whole voice-to-text process, so the solution is not quite useable when built as exe or apk or something else.
Where is this function sampleRate = SoundTools.Wav2Flac(filepath, flacName);
can you please post a more complete code, where did you get SoundTools?? Thanks
Up ?
The example code posted here works well:
I try use it but not work. Its part some wider project. How can I use it in practice?
Yup I agree Kith000 I have been at this trying to find useful, step by step information on HOW the bloody hell to get voice recognition working in Unity for the last 2 years now and it’s an infinite loop of the classic “Run Around.”
Why is this such a difficult thing to find helpful information on? It’s just absolutely frustrating! There are loads of examples, videos and so on, on on and bloody on but no one takes the time to explain properly how it’s done, what gets downloaded where it goes how you set it up etcetera… Being on a Mac is probably even tougher.
Getting so frustrated with not finding any real useful information on HOW TO DO THIS?
Guys maybe it will be useful Unity Asset Store - The Best Assets for Game Making
is there any new progress available about Google Speech API connection with unity3d. phil_g provided code missing lots of things.
Hi guys,
I am looking for a speech recognition offline on mobile platform? Any suggestion?
Is it possible to implement the MFCC and DTW algorithms to tackle this issue?