コード例 #1
0
        public PreprocessViewModel()
        {
            PreprocessModel preprocessModel = new PreprocessModel();

            audioPath = preprocessModel.AudioPath;
            imagePath = preprocessModel.MelSpecImagePath;
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: osamainam777/mobiup
 public ActionResult PreProcess(PreprocessModel model)
 {
     try
     {
         Preprocessing p = new Preprocessing();
         p.Pre_processing(model._Name);
         return(Content("Done with PreProcessing"));
     }
     catch (Exception e)
     {
         return(Content(e.ToString()));
     }
 }
コード例 #3
0
        private async void OnOpenClick(object sender, RoutedEventArgs e)
        {
            string wavPath = await GetFilePath();

            PreprocessModel melSpectrogram = new PreprocessModel();
            var             softwareBitmap = melSpectrogram.GenerateMelSpectrogram(wavPath, ColorMelSpectrogramCheckBox.IsChecked ?? false);

            ViewModel.AudioPath           = wavPath;
            ViewModel.MelSpectrogramImage = softwareBitmap;

            //Image control only accepts BGRA8 encoding and Premultiplied/no alpha channel. This checks and converts
            //the SoftwareBitmap we want to bind.
            if (softwareBitmap.BitmapPixelFormat != BitmapPixelFormat.Bgra8 ||
                softwareBitmap.BitmapAlphaMode != BitmapAlphaMode.Premultiplied)
            {
                softwareBitmap = SoftwareBitmap.Convert(softwareBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
            }

            WavFilePath.Text = ViewModel.AudioPath;

            await((SoftwareBitmapSource)spectrogram.Source).SetBitmapAsync(softwareBitmap);
        }