/// <summary> /// Streams raw audio data and returns captured intent and entities /// </summary> /// <param name="witPipedStream">Audio stream</param> /// <param name="type">Type</param> /// <param name="encoding">Encoding</param> /// <param name="bits">Bits per sample</param> /// <param name="rate">Samples per second</param> /// <param name="order">Bytes order</param> /// <returns>Captured data</returns> public async Task <WitResponse> StreamRawAudio(WitPipedStream witPipedStream, string type, string encoding, int bits, int rate, ByteOrder order) { WitSpeechRequestTask witSpeechRequestTask = new WitSpeechRequestTask(accessToken, witPipedStream, type, encoding, bits, rate, order); string result = await witSpeechRequestTask.UploadAsync(); if (result != null) { WitResponse witResponse = JsonConvert.DeserializeObject <WitResponse>(result); return(witResponse); } return(null); }
/// <summary> /// Streams raw audio data and returns captured intent and entities /// </summary> /// <param name="witPipedStream">Audio stream</param> /// <param name="type">Type</param> /// <param name="encoding">Encoding</param> /// <param name="bits">Bits per sample</param> /// <param name="rate">Samples per second</param> /// <param name="order">Bytes order</param> /// <returns>Captured data</returns> public async Task<WitResponse> StreamRawAudio(WitPipedStream witPipedStream, string type, string encoding, int bits, int rate, ByteOrder order) { WitSpeechRequestTask witSpeechRequestTask = new WitSpeechRequestTask(accessToken, witPipedStream, type, encoding, bits, rate, order); string result = await witSpeechRequestTask.UploadAsync(); if (result != null) { WitResponse witResponse = JsonConvert.DeserializeObject<WitResponse>(result); return witResponse; } return null; }