コード例 #1
0
        public void StartRecognitionV2ToJson()
        {
            // This is just a sanity check for now
            var expected    = "{\"message\":\"StartRecognition\",\"audio_format\":{\"sample_rate\":44100,\"type\":\"raw\",\"encoding\":\"pcm_s16le\"},\"transcription_config\":{\"language\":\"en-US\"}}";
            var audioFormat = new Speechmatics.Realtime.Client.V2.Messages.AudioFormatSubMessage(AudioFormatType.Raw, AudioFormatEncoding.PcmS16Le, 44100);
            var msg         = new Speechmatics.Realtime.Client.V2.Messages.StartRecognitionMessage(audioFormat, "en-US");

            Assert.AreEqual(expected, msg.AsJson(), "Message serialization unexpected");
        }
コード例 #2
0
 public StartRecognitionMessage(AudioFormatSubMessage audioFormatSubMessage, string model)
 {
     audio_format         = audioFormatSubMessage;
     transcription_config = new { language = model };
 }