Skip to content

Commit f3e56f5

Browse files
maiko3tattunMaiko
andauthored
Fix crash when playing test sound on an unavailable audio device (#1614)
Co-authored-by: Maiko <[email protected]>
1 parent 201f874 commit f3e56f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

OpenUtau/ViewModels/PreferencesViewModel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using ReactiveUI;
1313
using ReactiveUI.Fody.Helpers;
1414
using OpenUtau.Core.Render;
15+
using Serilog;
1516

1617
namespace OpenUtau.App.ViewModels {
1718
public class PreferencesViewModel : ViewModelBase {
@@ -368,7 +369,12 @@ public PreferencesViewModel() {
368369
}
369370

370371
public void TestAudioOutputDevice() {
371-
PlaybackManager.Inst.PlayTestSound();
372+
try {
373+
PlaybackManager.Inst.PlayTestSound();
374+
} catch (Exception e) {
375+
Log.Error(e, "Failed to play test sound.");
376+
DocManager.Inst.ExecuteCmd(new ErrorMessageNotification("Failed to play test sound.", e));
377+
}
372378
}
373379

374380
public void OpenResamplerLocation() {

0 commit comments

Comments
 (0)