GithubHelp home page GithubHelp logo

j1mmyto9 / speech-and-text-unity-ios-android Goto Github PK

View Code? Open in Web Editor NEW
276.0 19.0 125.0 78.32 MB

Speed to text in Unity iOS use Native Speech Recognition

License: MIT License

Objective-C 0.49% Objective-C++ 22.46% C# 49.12% Java 27.93%
unity-ios unity-android speech

speech-and-text-unity-ios-android's Introduction

Speech And Text in Unity iOS and Unity Android

Speed to text and text to speed in Unity iOS and Unity Android I have provide all java and object c source. you can know how it work, optimization, or add any features

Native Speech and Text

Android

  • Hide default android popup, there's a bool to enable and disable if you don't want the popup to show up.
class SpeechToText
{
      public const bool isShowPopupAndroid = false;
      ...
  • Merge file AndroidManifest (If you want skip the default popup)

Tutorial Config in Xcode

  • Requires Xcode8 or higher. Target iOS 10.0

  • Add farmwork

    - speech.farmwork
    - AVFoundation.framework
    
  • Add permission

    - Privacy – Microphone Usage Description      
    - Privacy – Speech Recognition Usage Description
    

speech-and-text-unity-ios-android's People

Contributors

adaneko avatar calvma avatar campbell-codes avatar chris-o3h avatar elblogbruno avatar jack19910609 avatar khanhuitse05 avatar xiphereal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

speech-and-text-unity-ios-android's Issues

[Feature Request] Catch partial result?

Hi,

Thanks for writing this very useful plugin! It works great in my projects!

Now in my next project, I want to do a "recognize as I speak" style. I searched online and find only 1~2 demos but no tutorial nor example codes. I am not very familiar with Objective-C so I hope perhaps you know just the right way to do it. I think it would become a good and useful feature to add to this repo.

Thanks,

Record audio and use speech to text at the same time

Greetings and thank you for this project. Is there any possible way to get the recorded speech in an AudioClip? I would like to use the speech to text functionality but also be able to store the recorded result on the device as a .wav file.

I have tried the steps from the following link https://answers.unity.com/questions/354401/save-audio-to-a-file.html in order to record and save my voice input to my mobile and it is working correctly.

But if I use Microphone.Start and then call sampleSpeechToText.StartRecording() I receive: Network error and speech to text is not working at all. I suspect it is because of the microphone access but I am stuck.

License

Hi,

This repo is amazing, and was very easy to get setup and running. I would like to use this code in a project, however I would like to know the license before moving forward.

Thanks!

Android SpeechToText.cs

Hi, I'm trying to find why these lines in Android don't work:

(line 64) javaUnityClass.CallStatic("StartRecording");

and

(line 77) javaUnityClass.CallStatic("StopRecording");

I debug after those lines but nothing happens

Crash on iOs

Hi!

I've been testing your plugin on android and iOs, and while it work very well on Android,
I've been unable to have it work on iOs.

I've got this error in when trying to record voice by pressing the record button: speechandtext[1268:2125739] errorAudioEngine.description: (null)

A small square appear and rotate, but nothing happen for while before it crash.

Tried on a iPhone 6S (11.0.1) and a iPhone 6 (iOs 10.2.1) with xCode 9.0.1
Added the speech framework and AVfoundation and the right permissions.

Any idea?

Stack Overflow in unity 2018.4

I am using the text to speech script and have an error regarding the init method in the text to speech script
My code
`
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using TextSpeech;
public class Audio_service : MonoBehaviour
{
const string Lang_code = "en_US";
// Start is called before the first frame update
void Start()
{
Setup(Lang_code);
TextToSpeech.instance.onStartCallBack = OnSpeakStart;
TextToSpeech.instance.onDoneCallback = OnSpeakStop;

	StartSpeaking("Hello");
}
public void StartSpeaking(string message)
{
	TextToSpeech.instance.StartSpeak(message);
}
public void StopSpeaking()
{	
	TextToSpeech.instance.StopSpeak();	
}	
public void OnSpeakStart()
{
	Debug.Log("Speak started");
}
public void OnSpeakStop()
{
	Debug.Log("Speak stopped");
}

void Setup(string code)
{
	TextToSpeech.instance.Setting(code,1,1);		
	
}

}The runtime error
StackOverflowException: The requested operation caused a stack overflow.
UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) <0x3c0cea60 + 0x00008> in <89a5147921e548d1b8ddcff8078f62cd>:0
UnityEngine.Object.op_Equality (UnityEngine.Object x, UnityEngine.Object y) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:403)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:17)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:19)
TextSpeech.TextToSpeech.Init () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToSpeech.cs:26)
TextSpeech.TextToSpeech.get_instance () (at Assets/SpeechToText_AppleAPI/Assets/SpeechAndText/Scripts/TextToS
`

Error Building for IOS in unity > 2019.1

Hi, thanks for this great plugin.

I got it to work in unity 2019.1, but if i try to build for IOS in a version higher than 2019.1

it happens in 2019.3.13F1 and 2020.1.6f1.

I always getting the same error:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SFSpeechAudioBufferRecognitionRequest", referenced from: objc-class-ref in SpeechRecorderViewController.o "_OBJC_CLASS_$_SFSpeechRecognizer", referenced from: objc-class-ref in SpeechRecorderViewController.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am I doing something wrong? In my Frameworks, Libraries and Embedded content I have:

AVFoundation.framework
Speech.framework
UnityFramework.framework

and in my Build phases, link binaries with Libraries:

AVFoundation.framework
Speech.framework

Any help will be appreciated,

Thanks.

I subscribed a method to the onDoneCallback but it's never called.

I'm having trouble with the onDoneCallback. In my project, i need to stop a animation when the speech of the TTS is done, so i wrote a method and subscribed it in the onDoneCallback but this method is never called. How can i solve this? In which momment those callback are called by the TextToSpeech class?

Android - SpeechToText - Scene requires a GameObject named exactly 'SpeechToText'

Hi!

I've been doing some work with this plugin on Android for its Speech to Text capabilities.
I've found that neither the code nor the README.md file warns about the need of having a GameObject in the scene named exactly SpeechToText for the plugin to work. The Init() method in SpeechToText is supposed to create a GameObject with that same name, but it doesn't seem to work neither. I mean the callbacks a correctly called, but it seems that is something in the Java side that is causing the problem.
Could it be solved so that the code hints how the SpeechToText capabilities in this plugin really work? Or at least, warn about it in the README.md.

Thanks!

Keep getting "Error : Client side error"

In the provided sample scene I keep getting "Error : Client side error", I still get the recognized text though...

Furthermore I can't get it to work in another scene, I don't know if it's linked to the issue above or not.

Also documentation would be very appreciated to speed up integration and making it easier ^^'

XCode Build Failure

Hi, The plugin works on Android. But while building for iOS, the build fails in xcode with

Undefined symbols for architecture arm64:
"OBJC_CLASS$_SFSpeechAudioBufferRecognitionRequest", referenced from:
objc-class-ref in SpeechRecorderViewController.o
"OBJC_CLASS$_SFSpeechRecognizer", referenced from:
objc-class-ref in SpeechRecorderViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can you help with the fix for this?

Unity build fails on iOS on versions 2019.3.13 and 2019.4.1

I get the following error when I try to build with 2019.3.13f and 2019.4.1f. Everything works fine in Unity 2019.1.14f.

I am using Xcode 11.5 (11E608c)

ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) (at <fb001e01371b4adca20013e0ac763896>:0) System.Collections.Generic.Dictionary2[TKey,TValue].ContainsKey (TKey key) (at :0)
UnityEditor.iOS.Xcode.PBX.KnownSectionBase1[T].get_Item (System.String guid) (at /Users/builduser/buildslave/unity/build/External/XcodeAPI/Xcode/PBX/Sections.cs:86) UnityEditor.iOS.Xcode.PBXProject.AddBuildFileImpl (System.String targetGuid, System.String fileGuid, System.Boolean weak, System.String compileFlags) (at /Users/builduser/buildslave/unity/build/External/XcodeAPI/Xcode/PBXProject.cs:258) UnityEditor.iOS.Xcode.PBXProject.AddFrameworkToProject (System.String targetGuid, System.String framework, System.Boolean weak) (at /Users/builduser/buildslave/unity/build/External/XcodeAPI/Xcode/PBXProject.cs:520) BuildPostProcessor.AddFrameworks (UnityEditor.iOS.Xcode.PBXProject project, System.String targetGUID) (at Assets/SpeechAndText/Editor/BuildPostProcessor.cs:40) BuildPostProcessor.OnPostProcessBuild (UnityEditor.BuildTarget target, System.String path) (at Assets/SpeechAndText/Editor/BuildPostProcessor.cs:25) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fb001e01371b4adca20013e0ac763896>:0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fb001e01371b4adca20013e0ac763896>:0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <fb001e01371b4adca20013e0ac763896>:0) UnityEditor.Build.BuildPipelineInterfaces+AttributeCallbackWrapper.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:177) UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass17_0.<OnBuildPostProcess>b__1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:433) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:391)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)

User stops Speaking - Increase the time-out duration

Everything works fine but one issue I am facing I keep getting user stops speaking and client-side error after.

Observation: if we give a pause of 2-3 seconds OnEndSpeech callback is triggered.(Android Phone)

is there a way to increase the duration of how long the user can keep quiet or any walk around for this?
right now it says the user stops speaking if i pause for 2-3 seconds any ways on how to increase the duration.

Thanks in advance.
Cheers!!

Speech Recognition wont start a second time

Hello @PingAK9, awesome work and great sample!

I've deployed this to my phone with the following configuration:

  • Phone: Pixel XL (first generation)
  • Unity: 2017.4.3f1
  • Android API Level: 27

The application runs exactly as expected the first time I press the microphone button. Speech is understood and spoken back properly using TTS. However, the second time I press the microphone button it doesn't work. Android makes the Beep sound like it is starting to listen, but then it immediately makes another double-beep failure sound and nothing is recognized.

Any idea what could be wrong or how I could fix it?

Thanks!!!

Unspecified License

I would like to refer to this code in another sample, but the sample we're working on is released under the MIT license.

I don't see a license for this project. Can you confirm the license and let us know if we can leverage it in our MIT licensed sample?

Thanks!

Launch of App timesout when not launched directly from XCode

Unity 2019.3.13f1
Device: iPhone SE (original)
iOS: 13.6

When I launch the app using the xcode debugger it works. However if I kill the app and launch it again. Or launch it from xcode with the option "wait for executable to be launched". It hangs without even showing the unity symbol on the launch splash screen. This only happens when I add this plugin (and very occasionally it works). If I remove the plugin it works again. This happens even if I do not have code that calls the library.

If I run using "wait for executable to be launched" and debug I get
Thread 1: signal SIGSTOP

Ocassionally I will get
Thread 1: EXC_BAD_ACCESS (code=50, address=0x1002b6104)
And eventually the error:
Message from debugger: Terminated due to code signing error
But this is occassional.

I'm not sure if this issue occurs on older versions of unity.

Changing voices

Hey, thank you for a great tool! Is there a way to change the voice to male etc?

Not working on Android 11

Hi, thanks for your great plugin.
It working great on androids under 11, but it not working on android 11.
Can you help me to fix this on android 11?

Message when user don't say nothing

Great code! Thanks a lot!

I have a doubt:

How do I display a message (eg, "I didn't hear what you said") when the user doesn't say anything and so the system doesn't hear any word?

Can someone help me?

Implement Partial Results for iOS

Hi,

Thanks for the excellent work. Could someone add support for partial results for IOS?
I would like to have continuous speech recognition and with this method, it could be achieved. I would simply send a stop listening followed immediately by a start listening after 1 second or so of no changes in the partial results, indicating a pause in speaking.

Let me know. Thanks!

Is it real to apply any grammar?

Is it real to apply grammar (set specific phrases or context, which will be pronounced more often than others)?
There is some "improving Speech-To-Text accuracy in Google API", (https://youtu.be/MzURq2Py4pc), could this might be applicable here?

If we could apply grammar here, it really would be the best and most comfortable PlugIn for Android/IOS recognition!
Thanks!

Text to Speech as a AudioSource in Unity?

Hi
Absolutely great to vie able to work with speech in Unity. Thanks for sharing this project.

I was wondering if it is possible to get the Text2Speech audio as an AudioSource in Unity?
I would like to use the spoken text to drive lip-sync of a character.

cheers, volker

Treo khi sử dụng Speech 2-3 lần ở IOS

Em chào anh,

Em có thử sử dụng trên Iphone 6s (11.3.1) thì bị treo khi em sử dụng 2-3 lần speech. Nó bị treo ở animation xanh lá ạ.

Không biết lỗi này có thể sửa như nào anh.

Em cảm ơn anh.

Unity app crashes on Landscape mode (Android).

I have a problem since I added this plugin on my project. While working on portrait works very well, when I have to use Landscape display (which my app was designed for), it crashes without warning. I know it happened while using the plugin, because it never crashed without it. I want to know if is there a way to solve that issue.

java.lang.ClassCastException

When i am trying to use Speech To Text in My app. Am getting this error.
java.lang.ClassCastException: com.unity3d.player.UnityPlayerActivity cannot be cast to com.starseed.speechtotext.MainActivity
java.lang.ClassCastException: com.unity3d.player.UnityPlayerActivity cannot be cast to com.starseed.speechtotext.MainActivity
at com.starseed.speechtotext.Bridge.StartRecording(Bridge.java:32)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)

Can you help me to resolve this issue?

Building on top of this . . .

Hey

I built on top of this

github.com/stackedflows/Chatbot

Now you can talk to a chatbot and it will talk back to you!

IsShowPopup bool = false crashe error

Hi !

On Unity2020.1.17f1, the Speechtotext functionality of the package work as intended , except for the ability to desactivate the popup display on android:

As soon as the flag is passed to false, the android build crash when calling the method Start Recording & stop recording: it seems to be provoked by the inability to cast the currentActivity to a UnityMainActivity type( the current activity seems to be the Bridge one ) .

Am I missing something in order to make this functionality work properly, or has the unity android activity evolved in some way that would create an incompatibility between the most recent version of unity & this very useful piece of code ?

Thank you for your attention , i'm looking forward to you answer !

Unable to access both classes

After adding

using TextSpeech;

to my unity C# script, I found that I can only access one class.

In other words, I can only use the SpeechToText class and methods.

(I might be getting a beginner mistake since, I only know python and C, so my C# is only o.k.)

EDIT

I opened a new project and redid everything from scratch.
Working like a charm now.

Trouble with Android Voice

I am having trouble with the Android Voice part here. I am building a project that use Speech and text for both IOS and Android. The iOS part is working fine but the Android part is showing a pop up in Korean and the it is not recognizing the speech. Any ideas on how I can get this to work? Unity 2019.4.20f

Any payment required?

Hi, for some of the projects that Ive found speech and text support, some sort of price is attached in order to use their services. For this project, is there anything we have to subscribe to / pay for? Just want to know before diving into the project

TTS Doesn't work on existing project

I got the Plugins folder and the SpeechAndText folder form the Assets folder. I deleted the AndroidManifest.xml from the plugins.

I am sure the script I made to use the plugin works, tested it by opening the UnityProject in the repo and adding my script. However, using it on an existing project won't work.

Made sure the GameObject's name is TextToSpeech, even went as far as using the Prefab in the SpeechAndText folder

The voice of TTS is too weird and robotic on Android device, hard to understand the words.

I tried to change the setting and the voice doesn't change.
Here's my code.

using TextSpeech;
const string LANG_CODE = "en-US";

void Start()
{
Setup(LANG_CODE);
StartSpeaking();
}
public void StartSpeaking()
{
string message = "Hello, welcome to Dark Run. Slide up to start the game," +
"slide down to quit the game.";
TextToSpeech.instance.StartSpeak(message);
}
void Setup(string code)
{
TextToSpeech.instance.Setting(code, 1, 1);
}

Lỗi không kết nối được với file jar

Em chào anh,
Em đang gặp một lỗi, ở project demo thì hoạt động bình thường. Tuy nhiên khi import sang 1 project khác thì không thể gọi được hàm của file jar. Debug đã gọi đến hàm Start recording và stop recording, tuy nhiên sau đó không có gì xảy ra, không hiển thị lỗi nào cả cũng không có bất kỳ log nào. Log trong script AndroidLog cũng không thấy hiển thị. Test trên Android và em đã thử xóa đi import lại nhưng vẫn không được.

Not working on oculus Quest 2

Maybe a dumb question but I tried using it on oculus Quest 2 with Oculus integration
Everything else in the scene works except this one.
The button just keeps animating on pressing.
What could be the reason for no activity on Oculus Quest platform ?

errorAudioEngine

First of all I love this project you are amazing!
Android works fantastic but when I call:
SpeechToText.instance.StartRecording("say something...");
on iOS I get:
errorAudioEngine Description: (null)
in Xcode and nothing else happens. The result callback is never called. Any ideas?

iOS: pressing record btn in SampleScene freezes scene/game for 0.5s - 1s on actual device

When i press the record btn to start talking on my iphone 6s, everything in the scene freezes for 0.5 - 1s. When I run this same scene in the xcode simulator, there is no timeout/delay.

It looks like creating an AVAudioSession every time we startRecording is causing the issue

AVAudioSession *session = [AVAudioSession sharedInstance]; [session setCategory:AVAudioSessionCategoryPlayAndRecord mode:AVAudioSessionModeMeasurement options:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil]; [session setActive:TRUE withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];

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.