Merge pull request #1072 from MihailRis/dev
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run

0.33 development
This commit is contained in:
MihailRis 2026-11-04 16:23:46 +03:00 • committed by GitHub
commit 97c790350d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
216 changed files with 6838 additions and 2590 deletions

View file

@ -262,6 +262,18 @@ std::unique_ptr<Sound> audio::create_sound(
}
std::unique_ptr<PCMStream> audio::open_PCM_stream(const io::path& file) {
if (!io::exists(file)) {
io::path candidate = file.string() + ".wav";
if (io::exists(candidate)) {
return wav::create_stream(candidate);
}
candidate = file.string() + ".ogg";
if (io::exists(candidate)) {
return ogg::create_stream(candidate);
}
throw std::runtime_error("file not found '" + file.string() + "'");
}
std::string ext = file.extension();
if (ext == ".wav" || ext == ".WAV") {
return wav::create_stream(file);