public virtual void PostStereo(string filename, SpeechAudioChannel channel, SpeechIdentifier.PostCallback callback) { if (IsSessionOpen) { if (AppendStereo(filename, channel)) { Post(callback); } } }
public virtual void Post(WaveStream stream, SpeechIdentifier.PostCallback callback) { if (IsSessionOpen) { if (Append(stream)) { Post(callback); } } }
public virtual void Post(string filename, SpeechIdentifier.PostCallback callback) { if (IsSessionOpen) { if (Append(filename)) { Post(callback); } } }
public override void Post(SpeechIdentifier.PostCallback callback) { if (IsSessionOpen && !IsSessionClosing) { IdentifyResults.Clear(); Uri uri = Configuration.Server.BuildEndpoint(URI_PATH_PROCESS); Logger?.LogDebug("SpeechIdentifier_HttpClient_Version1.Post(callback): URI: " + uri.ToString()); using (var request = BuildRequest(CallMode.Process, uri)) { var task = mHttpClient.SendAsync(request).ContinueWith((requestTask) => { if (requestTask.IsFaulted) { IdentifyResult = SpeechIdentifier.Result.Timeout; Logger?.LogError(requestTask.Exception); callback?.Invoke(IdentifyResult); return; } HandleResponse(CallMode.Process, request, requestTask.Result).ContinueWith((responseTask) => { if (responseTask.IsFaulted) { IdentifyResult = SpeechIdentifier.Result.Timeout; Logger?.LogError(responseTask.Exception); callback?.Invoke(IdentifyResult); return; } callback?.Invoke(IdentifyResult); }); }); if (task.IsFaulted) { IdentifyResult = SpeechIdentifier.Result.Timeout; Logger?.LogError(task.Exception); callback?.Invoke(IdentifyResult); } return; } } callback?.Invoke(IdentifyResult = SpeechIdentifier.Result.Invalid); }
public virtual void PostStereo(WaveStream stream, SpeechAudioChannel channel, SpeechIdentifier.PostCallback callback) { if (IsSessionOpen) { if (AppendStereo(stream, channel)) { Post(callback); } } }
public abstract void Post(SpeechIdentifier.PostCallback callback);