Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic app that displays a melspectrogram generated from an audio file #395

Merged
merged 36 commits into from
Jul 1, 2021

Conversation

janezdu
Copy link
Contributor

@janezdu janezdu commented Jun 30, 2021

  • Switch main architecture of project to WinUI 3, instead of WPF.
    • Main Solution Found in Samples/AudioPreprocessing/WinUI/AudioPreprocessing/
  • Uses appropriate FileOpenPicker (not System.Windows.Forms) to choose .wav file
  • displays one MelSpectrogram in the center of the app.

image

Currently, the button SaveFile and the textbox below it (that displays the path to which the image is saved) do not work with these changes.

@janezdu janezdu requested a review from a team as a code owner June 30, 2021 18:07
@tiagoshibata tiagoshibata self-requested a review June 30, 2021 23:26
Comment on lines 71 to 72
var initializeWithWindowWrapper = Marshal.GetTypedObjectForIUnknown(picker_unknown, typeof(IInitializeWithWindow)) as IInitializeWithWindow;
Debug.Assert(initializeWithWindowWrapper != null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cast throws an exception if it fails:

var initializeWithWindowWrapper = (IInitializeWithWindow)Marshal.GetTypedObjectForIUnknown(picker_unknown, typeof(IInitializeWithWindow));

It's probably better than doing as and then asserting (and it seems from GetTypedObjectForIUnknown docs that it always returns a IInitializeWithWindow or throws an exception, so the assertion seems to always succeed?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me.

@janezdu janezdu merged commit e3ce819 into master Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants