noir-neo / UniSpeech

iOS speech framework native plugin for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UniSpeech

iOS Speech framework plugin for Unity

Installation

  1. From Source
    • Clone this repo and copy the Assets/UniSpeech/Pluigins/iOS/ and Assets/UnitySwift/ directory to your own project.

Usage

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 image

Sample

See UniSpeech/Sample

Requirements

  • iOS 10+

License

the MIT License.

Dependent on miyabi/unity-swift

About

iOS speech framework native plugin for Unity

License:MIT License


Languages

Language:C# 53.5%Language:Swift 38.7%Language:Objective-C++ 6.3%Language:Objective-C 1.5%