mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 17:39:46 +00:00
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
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:
commit
97c790350d
216 changed files with 6838 additions and 2590 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue