- Home /
Integrating Watson Speech-to-Text with Unity
Hi, I am trying to integrate IBM's Watson into my project for the purpose of speech-to-text, but am pretty mixed up about WWW & WWWForm, and what alternatives Do work within Unity 5. Presently, I can record the audio input from the microphone to a WAV file, and then I need help to figure out the appropriate way to connect it to Watson.
The Client side (Unity) - Mainly C# code.
One script will continuously record microphone input, and will save to a new audio file every 15 seconds.
And then another script will handle communication with Watson - 1) if "file_"+x+".wav" exists, send it to watson and wait for response back. process json result (as simple as printing the transcript portion), and then repeat.
Finally, the program will run on a pc with Windows 7 (I wish I could use linux but alas, I am only a pawn in this endeavor). I really appreciate any help - thank you,
Watson Docs https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/speech-to-text/api/v1/?java#recognize
REST Methods http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/apis/#!/speech-to-text
You may want to check this out... Just put out this week: https://developer.ibm.com/open/2016/01/21/introducing-watson-unity-sdk/
Answer by BelinExperience · May 27, 2017 at 02:19 PM
The mechanism you're proposing has already been superseded by a streaming protocol. You can get on the fly results from audio which you collect and send immediately, and the evolving results eventually come back as a final translation with a matrix of available alternates.
IBM provides an example in the SDK for how to use the speech to text streaming. It works well in your proposed environment.
watson-sdk\Scripts\Widgets\SpeechToTextWidget.cs
If you add this script to an object in your scene, and configure the speech to text service in the Unity IDE's WATSON menu, it should debug the text results as they are obtained.