summaryrefslogtreecommitdiff
path: root/Applications/SoundPlayer/SoundPlayerWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Applications/SoundPlayer/SoundPlayerWidget.cpp')
-rw-r--r--Applications/SoundPlayer/SoundPlayerWidget.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/Applications/SoundPlayer/SoundPlayerWidget.cpp b/Applications/SoundPlayer/SoundPlayerWidget.cpp
index 0402e38817..1f44f97d1c 100644
--- a/Applications/SoundPlayer/SoundPlayerWidget.cpp
+++ b/Applications/SoundPlayer/SoundPlayerWidget.cpp
@@ -119,15 +119,10 @@ void SoundPlayerWidget::hide_scope(bool hide)
void SoundPlayerWidget::open_file(String path)
{
- if (!path.ends_with(".wav")) {
- GUI::MessageBox::show(window(), "Selected file is not a \".wav\" file!", "Filetype error", GUI::MessageBox::Type::Error);
- return;
- }
-
- OwnPtr<Audio::WavLoader> loader = make<Audio::WavLoader>(path);
+ NonnullRefPtr<Audio::Loader> loader = Audio::Loader::create(path);
if (loader->has_error()) {
GUI::MessageBox::show(window(),
- String::formatted("Failed to load WAV file: {} ({})", path, loader->error_string()),
+ String::formatted("Failed to load audio file: {} ({})", path, loader->error_string()),
"Filetype error", GUI::MessageBox::Type::Error);
return;
}