Exemplo n.º 1
0
        private static void LongSentence(String token, String endpoint)
        {
            String dataUrl    = "";                                                     // The obs url of file
            String categories = "common";                                               // The scene of detect

            // post data by native file
            String data   = utils.ConvertFileToBase64("../../data/asr-sentence.wav");
            String reslut = Asr.LongSentenceToken(token, data, dataUrl, categories, endpoint);

            Console.WriteLine(reslut);

            dataUrl = "https://ais-sample-data.obs.myhuaweicloud.com/lsr-1.mp3";

            // post data by obs url
            reslut = Asr.LongSentenceToken(token, "", dataUrl, categories, endpoint);
            Console.WriteLine(reslut);
            Console.ReadKey();
        }
Exemplo n.º 2
0
        private static void LongSentence(String token, String endpoint)
        {
            // The obs url of file
            String dataUrl = "";
            // The scene of detect
            String categories = "common";

            // post data by native file
            String data   = utils.ConvertFileToBase64("../../data/asr-sentence.wav");
            String reslut = Asr.LongSentenceToken(token, data, dataUrl, categories, endpoint);

            Console.WriteLine(reslut);

            // The OBS link must match the region, and the OBS resources of different regions are not shared
            dataUrl = "https://obs-ch-sdk-sample.obs.cn-north-1.myhwclouds.com/lsr-1.mp3";

            // post data by obs url
            reslut = Asr.LongSentenceToken(token, "", dataUrl, categories, endpoint);
            Console.WriteLine(reslut);
            Console.ReadKey();
        }