Beispiel #1
0
        /// <summary>
        /// Capture intent and entities from a microphone
        /// </summary>
        /// <returns>Captured data</returns>
        public async Task <WitResponse> CaptureVoiceIntent()
        {
            WitPipedStream witPipedStream = new WitPipedStream();

            witMic = new WitMic(witPipedStream, DetectSpeechStop);

            if (witMic.StartRecording())
            {
                return(await StreamRawAudio(witPipedStream, "audio/raw", "signed-integer", 16, 16000, ByteOrder.LITTLE_ENDIAN));
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// Capture intent and entities from a microphone
        /// </summary>
        /// <returns>Captured data</returns>
        public async Task<WitResponse> CaptureVoiceIntent()
        {
            WitPipedStream witPipedStream = new WitPipedStream();

            witMic = new WitMic(witPipedStream, DetectSpeechStop);

            if (witMic.StartRecording())
            {
                return await StreamRawAudio(witPipedStream, "audio/raw", "signed-integer", 16, 16000, ByteOrder.LITTLE_ENDIAN);
            }
            else
            {
                return null;
            }
        }