Speech Cancel

Action to detect Speech cancel

public void OnSpeechCancelled (string reason, long ts)

Parameter
Description

reason

The reason for the speech session cancellation

ts

The timestamp

To detect Speech session end, you need to implement callback method exposed through the VoiceManager: (string reason, long timeStamps)

using UnityEngine;
using JMRSDK;

public class JMRDemoVoiceExample : MonoBehaviour
{
    private void OnEnable()
    {
        JMRVoiceManager.OnSpeechCancelled += SpeechCancelled;
    }

    private void OnDisable()
    {
        JMRVoiceManager.OnSpeechCancelled -= SpeechCancelled;
    }

    private void SpeechCancelled(string reason, long ts)
    {
        string spCancelReason = reason;
        long timeStamp = ts;
    }
}

Last updated