scripts
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Windows.Speech
|
||||
{
|
||||
// Token: 0x020000F3 RID: 243
|
||||
public abstract class PhraseRecognizer : IDisposable
|
||||
{
|
||||
// Token: 0x060011B2 RID: 4530 RVA: 0x0001795C File Offset: 0x00015B5C
|
||||
internal PhraseRecognizer()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060011B3 RID: 4531 RVA: 0x00017968 File Offset: 0x00015B68
|
||||
protected IntPtr CreateFromKeywords(string[] keywords, ConfidenceLevel minimumConfidence)
|
||||
{
|
||||
IntPtr intPtr;
|
||||
PhraseRecognizer.INTERNAL_CALL_CreateFromKeywords(this, keywords, minimumConfidence, out intPtr);
|
||||
return intPtr;
|
||||
}
|
||||
|
||||
// Token: 0x060011B4 RID: 4532
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void INTERNAL_CALL_CreateFromKeywords(PhraseRecognizer self, string[] keywords, ConfidenceLevel minimumConfidence, out IntPtr value);
|
||||
|
||||
// Token: 0x060011B5 RID: 4533 RVA: 0x00017988 File Offset: 0x00015B88
|
||||
protected IntPtr CreateFromGrammarFile(string grammarFilePath, ConfidenceLevel minimumConfidence)
|
||||
{
|
||||
IntPtr intPtr;
|
||||
PhraseRecognizer.INTERNAL_CALL_CreateFromGrammarFile(this, grammarFilePath, minimumConfidence, out intPtr);
|
||||
return intPtr;
|
||||
}
|
||||
|
||||
// Token: 0x060011B6 RID: 4534
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void INTERNAL_CALL_CreateFromGrammarFile(PhraseRecognizer self, string grammarFilePath, ConfidenceLevel minimumConfidence, out IntPtr value);
|
||||
|
||||
// Token: 0x060011B7 RID: 4535
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void Start_Internal(IntPtr recognizer);
|
||||
|
||||
// Token: 0x060011B8 RID: 4536
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void Stop_Internal(IntPtr recognizer);
|
||||
|
||||
// Token: 0x060011B9 RID: 4537
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool IsRunning_Internal(IntPtr recognizer);
|
||||
|
||||
// Token: 0x060011BA RID: 4538
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void Destroy(IntPtr recognizer);
|
||||
|
||||
// Token: 0x060011BB RID: 4539
|
||||
[ThreadAndSerializationSafe]
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void DestroyThreaded(IntPtr recognizer);
|
||||
|
||||
// Token: 0x1400000B RID: 11
|
||||
// (add) Token: 0x060011BC RID: 4540 RVA: 0x000179A8 File Offset: 0x00015BA8
|
||||
// (remove) Token: 0x060011BD RID: 4541 RVA: 0x000179E0 File Offset: 0x00015BE0
|
||||
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
public event PhraseRecognizer.PhraseRecognizedDelegate OnPhraseRecognized;
|
||||
|
||||
// Token: 0x060011BE RID: 4542 RVA: 0x00017A18 File Offset: 0x00015C18
|
||||
~PhraseRecognizer()
|
||||
{
|
||||
if (this.m_Recognizer != IntPtr.Zero)
|
||||
{
|
||||
PhraseRecognizer.DestroyThreaded(this.m_Recognizer);
|
||||
this.m_Recognizer = IntPtr.Zero;
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060011BF RID: 4543 RVA: 0x00017A78 File Offset: 0x00015C78
|
||||
public void Start()
|
||||
{
|
||||
if (!(this.m_Recognizer == IntPtr.Zero))
|
||||
{
|
||||
PhraseRecognizer.Start_Internal(this.m_Recognizer);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060011C0 RID: 4544 RVA: 0x00017AA0 File Offset: 0x00015CA0
|
||||
public void Stop()
|
||||
{
|
||||
if (!(this.m_Recognizer == IntPtr.Zero))
|
||||
{
|
||||
PhraseRecognizer.Stop_Internal(this.m_Recognizer);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060011C1 RID: 4545 RVA: 0x00017AC8 File Offset: 0x00015CC8
|
||||
public void Dispose()
|
||||
{
|
||||
if (this.m_Recognizer != IntPtr.Zero)
|
||||
{
|
||||
PhraseRecognizer.Destroy(this.m_Recognizer);
|
||||
this.m_Recognizer = IntPtr.Zero;
|
||||
}
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
// Token: 0x17000383 RID: 899
|
||||
// (get) Token: 0x060011C2 RID: 4546 RVA: 0x00017B00 File Offset: 0x00015D00
|
||||
public bool IsRunning
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Recognizer != IntPtr.Zero && PhraseRecognizer.IsRunning_Internal(this.m_Recognizer);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060011C3 RID: 4547 RVA: 0x00017B38 File Offset: 0x00015D38
|
||||
[RequiredByNativeCode]
|
||||
private void InvokePhraseRecognizedEvent(string text, ConfidenceLevel confidence, SemanticMeaning[] semanticMeanings, long phraseStartFileTime, long phraseDurationTicks)
|
||||
{
|
||||
PhraseRecognizer.PhraseRecognizedDelegate onPhraseRecognized = this.OnPhraseRecognized;
|
||||
if (onPhraseRecognized != null)
|
||||
{
|
||||
onPhraseRecognized(new PhraseRecognizedEventArgs(text, confidence, semanticMeanings, DateTime.FromFileTime(phraseStartFileTime), TimeSpan.FromTicks(phraseDurationTicks)));
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060011C4 RID: 4548 RVA: 0x00017B70 File Offset: 0x00015D70
|
||||
[RequiredByNativeCode]
|
||||
private unsafe static SemanticMeaning[] MarshalSemanticMeaning(IntPtr keys, IntPtr values, IntPtr valueSizes, int valueCount)
|
||||
{
|
||||
SemanticMeaning[] array = new SemanticMeaning[valueCount];
|
||||
int num = 0;
|
||||
for (int i = 0; i < valueCount; i++)
|
||||
{
|
||||
uint num2 = *(uint*)((byte*)(void*)valueSizes + (IntPtr)i * 4);
|
||||
SemanticMeaning semanticMeaning = new SemanticMeaning
|
||||
{
|
||||
key = new string(*(IntPtr*)((byte*)(void*)keys + (IntPtr)i * (IntPtr)sizeof(char*))),
|
||||
values = new string[num2]
|
||||
};
|
||||
int num3 = 0;
|
||||
while ((long)num3 < (long)((ulong)num2))
|
||||
{
|
||||
semanticMeaning.values[num3] = new string(*(IntPtr*)((byte*)(void*)values + (IntPtr)(num + num3) * (IntPtr)sizeof(char*)));
|
||||
num3++;
|
||||
}
|
||||
array[i] = semanticMeaning;
|
||||
num += (int)num2;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x0400023D RID: 573
|
||||
protected IntPtr m_Recognizer;
|
||||
|
||||
// Token: 0x020000F4 RID: 244
|
||||
// (Invoke) Token: 0x060011C6 RID: 4550
|
||||
public delegate void PhraseRecognizedDelegate(PhraseRecognizedEventArgs args);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user