iOS Speech framework plugin for Unity
- From Source
- Clone this repo and copy the
Assets/UniSpeech/Pluigins/iOS/
andAssets/UnitySwift/
directory to your own project.
- Clone this repo and copy the
using UniSpeech;
using UnityEngine;
public class SpeechRecognizer : MonoBehaviour, ISpeechRecognizer
{
void Start()
{
UniSpeech.SpeechRecognizer.CallbackGameObjectName = gameObject.name;
UniSpeech.SpeechRecognizer.RequestRecognizerAuthorization();
}
public void OnAuthorized()
{
UniSpeech.SpeechRecognizer.StartRecord();
}
public void OnRecognized(string transcription)
{
Debug.Log("OnRecognized: " + transcription);
}
public void OnError(string description) { }
public void OnUnauthorized() { }
public void OnAvailable() { }
public void OnUnavailable() { }
}
You need to configure Edit > Project Settings > Player > iOS > Other Settings > Microphone Usage Description
See UniSpeech/Sample
- iOS 10+
the MIT License.
Dependent on miyabi/unity-swift