This commit is contained in:
janezdu 2021-07-02 13:16:23 -04:00
Родитель dc5e906268
Коммит 0722f5f99d
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -11,18 +11,18 @@
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
<StackPanel Margin="0,0,0,0" Background="White" Orientation="Vertical">
<StackPanel Background="White" Orientation="Vertical">
<Button Name="ShowFilePickerButton" Content="Open file" HorizontalAlignment="Center" Click = "OnOpenClick"
VerticalAlignment="Center" />
<TextBlock Name="WavFilePath" HorizontalAlignment="Center"
VerticalAlignment="Center" />
VerticalAlignment="Center" />
<CheckBox x:Name = "ColorMelSpectrogramCheckBox" Margin = "10" Content = "Check to render Mel Spectrogram with color" HorizontalAlignment="Center"/>
<TextBlock Name="WavFilePath" Text="{x:Bind ViewModel.AudioPath}" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Button Name="SaveFilebutton" Command="{x:Bind ViewModel.SaveFileCommand}" Content="Save file" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<TextBlock Name="ImagePath" Text="{x:Bind ViewModel.ImagePath}" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<TextBlock Name="ImagePath" Text="{x:Bind ViewModel.ImagePath}" HorizontalAlignment="Center" VerticalAlignment="Center" />
<StackPanel Margin="0,0,0,0" HorizontalAlignment="Center"
Background="White" Orientation="Horizontal">
<StackPanel HorizontalAlignment="Center" Background="White" Orientation="Horizontal">
<Image Name="spectrogram" Stretch="Fill" Height="500" Width="500" />
</StackPanel>
</StackPanel>

Просмотреть файл

@ -39,7 +39,7 @@ namespace AudioPreprocessing
{
string wavPath = await GetFilePath();
PreprocessModel melSpectrogram = new PreprocessModel();
var softwareBitmap = melSpectrogram.GenerateMelSpectrogram(wavPath, true);
var softwareBitmap = melSpectrogram.GenerateMelSpectrogram(wavPath, ColorMelSpectrogramCheckBox.IsChecked ?? false);
ViewModel.AudioPath = wavPath;
ViewModel.MelSpectrogramImage = softwareBitmap;