|
1 |
| -/* |
2 |
| - * Copyright (c) Meta Platforms, Inc. and affiliates. |
3 |
| - * All rights reserved. |
4 |
| - * |
5 |
| - * This source code is licensed under the license found in the |
6 |
| - * LICENSE file in the root directory of this source tree. |
7 |
| - */ |
8 |
| - |
9 |
| -using Facebook.WitAi.Lib; |
10 |
| -using System; |
11 |
| -namespace Oculus.Voice.Toolkit |
12 |
| -{ |
13 |
| - /// <summary> |
14 |
| - /// Implement this interface if you register the error state from VoiceUI Script. |
15 |
| - /// The data you received in the function should be converted to ErrorData. Example: ErrorData data = dataObj as ErrorData; |
16 |
| - /// </summary> |
17 |
| - public interface IErrorState |
18 |
| - { |
19 |
| - void ErrorHandler(VoiceDataBase data); |
20 |
| - |
21 |
| - } |
22 |
| - |
23 |
| - /// <summary> |
24 |
| - /// Implement this interface if you register the MicOn or MicOff state from VoiceUI Script. |
25 |
| - /// </summary> |
26 |
| - public interface IMicState |
27 |
| - { |
28 |
| - void MicOnHandler(VoiceDataBase data); |
29 |
| - void MicOffHandler(VoiceDataBase data); |
30 |
| - } |
31 |
| - |
32 |
| - /// <summary> |
33 |
| - /// Implement this interface if you register the listening state from VoiceUI Script. |
34 |
| - /// The data you received in the function should be converted to ListeningData. Example: ListeningData data = dataObj as ListeningData; |
35 |
| - /// </summary> |
36 |
| - public interface IListeningState |
37 |
| - { |
38 |
| - void ListeningHandler(VoiceDataBase data); |
39 |
| - } |
40 |
| - |
41 |
| - [Serializable] |
42 |
| - public class VoiceDataBase |
43 |
| - { |
44 |
| - } |
45 |
| - |
46 |
| - [Serializable] |
47 |
| - public class MicData : VoiceDataBase |
48 |
| - { |
49 |
| - } |
50 |
| - |
51 |
| - [Serializable] |
52 |
| - public class ErrorData : VoiceDataBase |
53 |
| - { |
54 |
| - |
55 |
| - public ErrorData(string type, string message) |
56 |
| - { |
57 |
| - this.type = type; |
58 |
| - this.message = message; |
59 |
| - } |
60 |
| - public string type; |
61 |
| - public string message; |
62 |
| - } |
63 |
| - |
64 |
| - [Serializable] |
65 |
| - public class ListeningData : VoiceDataBase |
66 |
| - { |
67 |
| - public float micLevel = 0; |
68 |
| - public string transcription = String.Empty; |
69 |
| - } |
70 |
| - |
71 |
| - [Serializable] |
72 |
| - public class NLUResponseData : VoiceDataBase |
73 |
| - { |
74 |
| - public DateTime requestTime; |
75 |
| - public DateTime responseTime; |
76 |
| - public WitResponseNode response = null; |
77 |
| - } |
78 |
| -} |
| 1 | +/* |
| 2 | + * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | + * All rights reserved. |
| 4 | + * |
| 5 | + * This source code is licensed under the license found in the |
| 6 | + * LICENSE file in the root directory of this source tree. |
| 7 | + */ |
| 8 | + |
| 9 | +using Facebook.WitAi.Lib; |
| 10 | +using System; |
| 11 | +namespace Oculus.Voice.Toolkit |
| 12 | +{ |
| 13 | + /// <summary> |
| 14 | + /// Implement this interface if you register the error state from VoiceUI Script. |
| 15 | + /// The data you received in the function should be converted to ErrorData. Example: ErrorData data = dataObj as ErrorData; |
| 16 | + /// </summary> |
| 17 | + public interface IErrorState |
| 18 | + { |
| 19 | + void ErrorHandler(VoiceDataBase data); |
| 20 | + |
| 21 | + } |
| 22 | + |
| 23 | + /// <summary> |
| 24 | + /// Implement this interface if you register the MicOn or MicOff state from VoiceUI Script. |
| 25 | + /// </summary> |
| 26 | + public interface IMicState |
| 27 | + { |
| 28 | + void MicOnHandler(VoiceDataBase data); |
| 29 | + void MicOffHandler(VoiceDataBase data); |
| 30 | + } |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// Implement this interface if you register the listening state from VoiceUI Script. |
| 34 | + /// The data you received in the function should be converted to ListeningData. Example: ListeningData data = dataObj as ListeningData; |
| 35 | + /// </summary> |
| 36 | + public interface IListeningState |
| 37 | + { |
| 38 | + void ListeningHandler(VoiceDataBase data); |
| 39 | + } |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// Implement this interface if you register the listening state from VoiceUI Script. |
| 43 | + /// The data you received in the function should be converted to ListeningData. Example: ListeningData data = dataObj as ListeningData; |
| 44 | + /// </summary> |
| 45 | + public interface IResponseState |
| 46 | + { |
| 47 | + void ResponseHandler(VoiceDataBase data); |
| 48 | + } |
| 49 | + public class VoiceDataBase |
| 50 | + { |
| 51 | + } |
| 52 | + public class MicData : VoiceDataBase |
| 53 | + { |
| 54 | + } |
| 55 | + public class ErrorData : VoiceDataBase |
| 56 | + { |
| 57 | + |
| 58 | + public ErrorData(string type, string message) |
| 59 | + { |
| 60 | + this.type = type; |
| 61 | + this.message = message; |
| 62 | + } |
| 63 | + public string type; |
| 64 | + public string message; |
| 65 | + } |
| 66 | + public class ListeningData : VoiceDataBase |
| 67 | + { |
| 68 | + public float micLevel = 0; |
| 69 | + public string transcription = String.Empty; |
| 70 | + } |
| 71 | + public class NLUResponseData : VoiceDataBase |
| 72 | + { |
| 73 | + public DateTime requestTime; |
| 74 | + public DateTime responseTime; |
| 75 | + public WitResponseNode response = null; |
| 76 | + } |
| 77 | +} |
0 commit comments