示例#1
0
        void Start()
        {
            // Setup service
            Service = new BingService {
                DoDebug = DoDebug
            };

            Service.OnError            += error => OnError.TryInvoke(error.Message);
            Service.OnSpeechHypothesis += hypothesis => OnHypothesis.TryInvoke(hypothesis.Text);
            Service.OnSpeechPhrase     += phrase => OnResult.TryInvoke(phrase.DisplayText);

            // Handle Mic
            m_Mic = Mic.Instance;
            m_Mic.StartRecording(16000, 20);
            m_Mic.OnSampleReady += (index, sample) => Service.Stream(sample.ToBytes());
        }