286 lines
9.1 KiB
C#
286 lines
9.1 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Runtime.CompilerServices;
|
|
using UnityEngine.Scripting;
|
|
|
|
namespace UnityEngine.Windows.Speech
|
|
{
|
|
// Token: 0x020000F5 RID: 245
|
|
public sealed class DictationRecognizer : IDisposable
|
|
{
|
|
// Token: 0x060011C9 RID: 4553 RVA: 0x00017C38 File Offset: 0x00015E38
|
|
public DictationRecognizer()
|
|
: this(ConfidenceLevel.Medium, DictationTopicConstraint.Dictation)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060011CA RID: 4554 RVA: 0x00017C44 File Offset: 0x00015E44
|
|
public DictationRecognizer(ConfidenceLevel confidenceLevel)
|
|
: this(confidenceLevel, DictationTopicConstraint.Dictation)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060011CB RID: 4555 RVA: 0x00017C50 File Offset: 0x00015E50
|
|
public DictationRecognizer(DictationTopicConstraint topic)
|
|
: this(ConfidenceLevel.Medium, topic)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060011CC RID: 4556 RVA: 0x00017C5C File Offset: 0x00015E5C
|
|
public DictationRecognizer(ConfidenceLevel minimumConfidence, DictationTopicConstraint topic)
|
|
{
|
|
this.m_Recognizer = this.Create(minimumConfidence, topic);
|
|
}
|
|
|
|
// Token: 0x060011CD RID: 4557 RVA: 0x00017C74 File Offset: 0x00015E74
|
|
private IntPtr Create(ConfidenceLevel minimumConfidence, DictationTopicConstraint topicConstraint)
|
|
{
|
|
IntPtr intPtr;
|
|
DictationRecognizer.INTERNAL_CALL_Create(this, minimumConfidence, topicConstraint, out intPtr);
|
|
return intPtr;
|
|
}
|
|
|
|
// Token: 0x060011CE RID: 4558
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Create(DictationRecognizer self, ConfidenceLevel minimumConfidence, DictationTopicConstraint topicConstraint, out IntPtr value);
|
|
|
|
// Token: 0x060011CF RID: 4559
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void Start(IntPtr self);
|
|
|
|
// Token: 0x060011D0 RID: 4560
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void Stop(IntPtr self);
|
|
|
|
// Token: 0x060011D1 RID: 4561
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void Destroy(IntPtr self);
|
|
|
|
// Token: 0x060011D2 RID: 4562
|
|
[ThreadAndSerializationSafe]
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void DestroyThreaded(IntPtr self);
|
|
|
|
// Token: 0x060011D3 RID: 4563
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern SpeechSystemStatus GetStatus(IntPtr self);
|
|
|
|
// Token: 0x060011D4 RID: 4564
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern float GetAutoSilenceTimeoutSeconds(IntPtr self);
|
|
|
|
// Token: 0x060011D5 RID: 4565
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void SetAutoSilenceTimeoutSeconds(IntPtr self, float value);
|
|
|
|
// Token: 0x060011D6 RID: 4566
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern float GetInitialSilenceTimeoutSeconds(IntPtr self);
|
|
|
|
// Token: 0x060011D7 RID: 4567
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void SetInitialSilenceTimeoutSeconds(IntPtr self, float value);
|
|
|
|
// Token: 0x1400000C RID: 12
|
|
// (add) Token: 0x060011D8 RID: 4568 RVA: 0x00017C94 File Offset: 0x00015E94
|
|
// (remove) Token: 0x060011D9 RID: 4569 RVA: 0x00017CCC File Offset: 0x00015ECC
|
|
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
|
public event DictationRecognizer.DictationHypothesisDelegate DictationHypothesis;
|
|
|
|
// Token: 0x1400000D RID: 13
|
|
// (add) Token: 0x060011DA RID: 4570 RVA: 0x00017D04 File Offset: 0x00015F04
|
|
// (remove) Token: 0x060011DB RID: 4571 RVA: 0x00017D3C File Offset: 0x00015F3C
|
|
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
|
public event DictationRecognizer.DictationResultDelegate DictationResult;
|
|
|
|
// Token: 0x1400000E RID: 14
|
|
// (add) Token: 0x060011DC RID: 4572 RVA: 0x00017D74 File Offset: 0x00015F74
|
|
// (remove) Token: 0x060011DD RID: 4573 RVA: 0x00017DAC File Offset: 0x00015FAC
|
|
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
|
public event DictationRecognizer.DictationCompletedDelegate DictationComplete;
|
|
|
|
// Token: 0x1400000F RID: 15
|
|
// (add) Token: 0x060011DE RID: 4574 RVA: 0x00017DE4 File Offset: 0x00015FE4
|
|
// (remove) Token: 0x060011DF RID: 4575 RVA: 0x00017E1C File Offset: 0x0001601C
|
|
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
|
public event DictationRecognizer.DictationErrorHandler DictationError;
|
|
|
|
// Token: 0x17000384 RID: 900
|
|
// (get) Token: 0x060011E0 RID: 4576 RVA: 0x00017E54 File Offset: 0x00016054
|
|
public SpeechSystemStatus Status
|
|
{
|
|
get
|
|
{
|
|
return (!(this.m_Recognizer != IntPtr.Zero)) ? SpeechSystemStatus.Stopped : DictationRecognizer.GetStatus(this.m_Recognizer);
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000385 RID: 901
|
|
// (get) Token: 0x060011E1 RID: 4577 RVA: 0x00017E90 File Offset: 0x00016090
|
|
// (set) Token: 0x060011E2 RID: 4578 RVA: 0x00017ED0 File Offset: 0x000160D0
|
|
public float AutoSilenceTimeoutSeconds
|
|
{
|
|
get
|
|
{
|
|
float num;
|
|
if (this.m_Recognizer == IntPtr.Zero)
|
|
{
|
|
num = 0f;
|
|
}
|
|
else
|
|
{
|
|
num = DictationRecognizer.GetAutoSilenceTimeoutSeconds(this.m_Recognizer);
|
|
}
|
|
return num;
|
|
}
|
|
set
|
|
{
|
|
if (!(this.m_Recognizer == IntPtr.Zero))
|
|
{
|
|
DictationRecognizer.SetAutoSilenceTimeoutSeconds(this.m_Recognizer, value);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000386 RID: 902
|
|
// (get) Token: 0x060011E3 RID: 4579 RVA: 0x00017EFC File Offset: 0x000160FC
|
|
// (set) Token: 0x060011E4 RID: 4580 RVA: 0x00017F3C File Offset: 0x0001613C
|
|
public float InitialSilenceTimeoutSeconds
|
|
{
|
|
get
|
|
{
|
|
float num;
|
|
if (this.m_Recognizer == IntPtr.Zero)
|
|
{
|
|
num = 0f;
|
|
}
|
|
else
|
|
{
|
|
num = DictationRecognizer.GetInitialSilenceTimeoutSeconds(this.m_Recognizer);
|
|
}
|
|
return num;
|
|
}
|
|
set
|
|
{
|
|
if (!(this.m_Recognizer == IntPtr.Zero))
|
|
{
|
|
DictationRecognizer.SetInitialSilenceTimeoutSeconds(this.m_Recognizer, value);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011E5 RID: 4581 RVA: 0x00017F68 File Offset: 0x00016168
|
|
~DictationRecognizer()
|
|
{
|
|
if (this.m_Recognizer != IntPtr.Zero)
|
|
{
|
|
DictationRecognizer.DestroyThreaded(this.m_Recognizer);
|
|
this.m_Recognizer = IntPtr.Zero;
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011E6 RID: 4582 RVA: 0x00017FC8 File Offset: 0x000161C8
|
|
public void Start()
|
|
{
|
|
if (!(this.m_Recognizer == IntPtr.Zero))
|
|
{
|
|
DictationRecognizer.Start(this.m_Recognizer);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011E7 RID: 4583 RVA: 0x00017FF0 File Offset: 0x000161F0
|
|
public void Stop()
|
|
{
|
|
if (!(this.m_Recognizer == IntPtr.Zero))
|
|
{
|
|
DictationRecognizer.Stop(this.m_Recognizer);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011E8 RID: 4584 RVA: 0x00018018 File Offset: 0x00016218
|
|
public void Dispose()
|
|
{
|
|
if (this.m_Recognizer != IntPtr.Zero)
|
|
{
|
|
DictationRecognizer.Destroy(this.m_Recognizer);
|
|
this.m_Recognizer = IntPtr.Zero;
|
|
}
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
|
|
// Token: 0x060011E9 RID: 4585 RVA: 0x00018050 File Offset: 0x00016250
|
|
[RequiredByNativeCode]
|
|
private void DictationRecognizer_InvokeHypothesisGeneratedEvent(string keyword)
|
|
{
|
|
DictationRecognizer.DictationHypothesisDelegate dictationHypothesis = this.DictationHypothesis;
|
|
if (dictationHypothesis != null)
|
|
{
|
|
dictationHypothesis(keyword);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011EA RID: 4586 RVA: 0x00018074 File Offset: 0x00016274
|
|
[RequiredByNativeCode]
|
|
private void DictationRecognizer_InvokeResultGeneratedEvent(string keyword, ConfidenceLevel minimumConfidence)
|
|
{
|
|
DictationRecognizer.DictationResultDelegate dictationResult = this.DictationResult;
|
|
if (dictationResult != null)
|
|
{
|
|
dictationResult(keyword, minimumConfidence);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011EB RID: 4587 RVA: 0x00018098 File Offset: 0x00016298
|
|
[RequiredByNativeCode]
|
|
private void DictationRecognizer_InvokeCompletedEvent(DictationCompletionCause cause)
|
|
{
|
|
DictationRecognizer.DictationCompletedDelegate dictationComplete = this.DictationComplete;
|
|
if (dictationComplete != null)
|
|
{
|
|
dictationComplete(cause);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060011EC RID: 4588 RVA: 0x000180BC File Offset: 0x000162BC
|
|
[RequiredByNativeCode]
|
|
private void DictationRecognizer_InvokeErrorEvent(string error, int hresult)
|
|
{
|
|
DictationRecognizer.DictationErrorHandler dictationError = this.DictationError;
|
|
if (dictationError != null)
|
|
{
|
|
dictationError(error, hresult);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0400023F RID: 575
|
|
private IntPtr m_Recognizer;
|
|
|
|
// Token: 0x020000F6 RID: 246
|
|
// (Invoke) Token: 0x060011EE RID: 4590
|
|
public delegate void DictationHypothesisDelegate(string text);
|
|
|
|
// Token: 0x020000F7 RID: 247
|
|
// (Invoke) Token: 0x060011F2 RID: 4594
|
|
public delegate void DictationResultDelegate(string text, ConfidenceLevel confidence);
|
|
|
|
// Token: 0x020000F8 RID: 248
|
|
// (Invoke) Token: 0x060011F6 RID: 4598
|
|
public delegate void DictationCompletedDelegate(DictationCompletionCause cause);
|
|
|
|
// Token: 0x020000F9 RID: 249
|
|
// (Invoke) Token: 0x060011FA RID: 4602
|
|
public delegate void DictationErrorHandler(string error, int hresult);
|
|
}
|
|
}
|