258 AiliaSpeech.AILIASpeechText text =
new AiliaSpeech.AILIASpeechText();
260 byte[] input_text_byte = System.Text.Encoding.UTF8.GetBytes(input_text+
"\u0000");
261 GCHandle input_text_handle = GCHandle.Alloc(input_text_byte, GCHandleType.Pinned);
262 IntPtr input_text_ptr = input_text_handle.AddrOfPinnedObject();
264 byte[] language_text_byte = System.Text.Encoding.UTF8.GetBytes(
"None\u0000");
265 GCHandle language_handle = GCHandle.Alloc(language_text_byte, GCHandleType.Pinned);
266 IntPtr language_text_ptr = language_handle.AddrOfPinnedObject();
268 text.text = input_text_ptr;
269 text.time_stamp_begin = 0.0f;
270 text.time_stamp_end = 0.0f;
271 text.confidence = 0.0f;
273 text.language = language_text_ptr;
276 int status = AiliaSpeech.ailiaSpeechSetText(net, text, AiliaSpeech.AILIA_SPEECH_TEXT_VERSION, idx);
278 Check(status,
"ailiaSpeechSetText");
282 status = AiliaSpeech.ailiaSpeechPostProcess(net);
284 Check(status,
"ailiaSpeechPostProcess");
288 status = AiliaSpeech.ailiaSpeechGetText(net, text, AiliaSpeech.AILIA_SPEECH_TEXT_VERSION, idx);
290 Check(status,
"ailiaSpeechGetText");
294 input_text_handle.Free();
295 language_handle.Free();
297 return Marshal.PtrToStringAnsi(text.text);