Ejemplo n.º 1
0
        void Inittony()
        {
            //BlobEngine = new AzureBlobHelper();
            httpClient = new HttpClient();
            //populate media
            mp = new MediaPlayer();
            //Attach the player to the MediaPlayerElement:
            Player1.SetMediaPlayer(mp);
            listMedia = new Dictionary <MediaBank, MediaItem>()
            {
                [MediaBank.Warning] = new MediaItem("https://archive.org/download/Urecord20140607.20.26.53/Urecord_2014-06-07.20.26.53.mp3"),
                [MediaBank.Alarm]   = new MediaItem("https://archive.org/download/Queen-WeWillRockYou_688/Queen-WeWillRockYou.mp3"),          //(@"ms-appx:///lagu/metal.mp3"),
                [MediaBank.Alert]   = new MediaItem("https://archive.org/download/Urecord20140607.20.26.53/Urecord_2014-06-07.20.26.53.mp3"), //(@"ms -appx:///lagu/lucu.mp3"),
                [MediaBank.Info]    = new MediaItem("https://archive.org/download/HotelCalifornia_201610/Hotel%20California.mp3")             //(@"ms -appx:///lagu/santai.mp3")
            };

            SongIDs.Add(Genre.Slow, new string[] { "C38MvuAtZjc", "qCGrJ7zVA7U", "DCMd-P9cxBo" });
            SongIDs.Add(Genre.Blues, new string[] { "zUuZ3CZYwDc", "fYr819V--ic", "oiyY81VOpBI" });
            SongIDs.Add(Genre.Jazz, new string[] { "YGURYe7coRU", "gz93tWf3TTE", "_sI_Ps7JSEk" });
            SongIDs.Add(Genre.Rock, new string[] { "_wii6Tfb4RQ", "_wii6Tfb4RQ", "O0Az_HYNu4g" });
            SongIDs.Add(Genre.Electro, new string[] { "5uB4HCVD4Ec", "4XpDdIISlYo", "c17k4LfLkaE", "MD_p19guYcs", "Xh2DEUUR7QU" });

            Player1.MediaPlayer.Volume = 80;
            Player1.AutoPlay           = false;

            PopulateCommands();

            //init intelligent service
            ApiContainer.Register <FaceService>(new FaceService());
            ApiContainer.Register <ComputerVisionService>(new ComputerVisionService());
            ApiContainer.Register <LuisHelper>(new LuisHelper());

            isListening = false;

            //if (timer == null)
            //{
            //    timer = new Timer(OnTimerTick, null, new TimeSpan(0, 0, 1), new TimeSpan(0, APPCONTANTS.IntervalTimerMin, 0));


            //}
        }