33{
34 if (!fs::exists(filepath) || !fs::is_regular_file(filepath)) {
35 return false;
36 }
37
38 auto ext = filepath.extension().string();
39 std::ranges::transform(ext, ext.begin(),
40 [](unsigned char c) { return std::tolower(c); });
41
42 static const std::unordered_set<std::string> audio_extensions = {
43 ".wav", ".aiff", ".aif", ".flac", ".ogg",
44 ".mp3", ".m4a", ".wma"
45 };
46
47 return audio_extensions.contains(ext);
48}