Skip to content

Commit

Permalink
fix: silent startup crash on missing native dependency
Browse files Browse the repository at this point in the history
Display an error dialog when a native library cannot be loaded.
  • Loading branch information
protyposis committed Dec 9, 2023
1 parent 4e6017b commit fa11c05
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions AudioAlign/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,25 @@ public partial class MainWindow : Window

public MainWindow()
{
// Use PFFFT as FFT implementation
FFTFactory.Factory = new Aurio.PFFFT.FFTFactory();
// Use Soxr as resampler implementation
ResamplerFactory.Factory = new Aurio.Soxr.ResamplerFactory();
// Use FFmpeg for file reading/decoding
AudioStreamFactory.AddFactory(new FFmpegAudioStreamFactory());
try
{
// Use PFFFT as FFT implementation
FFTFactory.Factory = new Aurio.PFFFT.FFTFactory();
// Use Soxr as resampler implementation
ResamplerFactory.Factory = new Aurio.Soxr.ResamplerFactory();
// Use FFmpeg for file reading/decoding
AudioStreamFactory.AddFactory(new FFmpegAudioStreamFactory());
}
catch (Exception e)
{
MessageBox.Show(
e.Message,
"AudioAlign startup error",
MessageBoxButton.OK,
MessageBoxImage.Error,
MessageBoxResult.Yes
);
}

recentProjects = new RecentProjects();

Expand Down

0 comments on commit fa11c05

Please sign in to comment.