ogg decoder

This commit is contained in:
MihailRis
2024-02-28 13:22:33 +03:00
parent e3c2a1da52
commit 145ebf8468
5 changed files with 77 additions and 2 deletions
+4 -1
View File
@@ -7,6 +7,7 @@
#include "NoAudio.h"
#include "../coders/wav.h"
#include "../coders/ogg.h"
namespace audio {
static speakerid_t nextId = 1;
@@ -30,7 +31,9 @@ PCM* audio::loadPCM(const fs::path& file, bool headerOnly) {
std::string ext = file.extension().u8string();
if (ext == ".wav" || ext == ".WAV") {
return wav::load_pcm(file, headerOnly);
} // TODO: OGG support
} else if (ext == ".ogg" || ext == ".OGG") {
return ogg::load_pcm(file, headerOnly);
}
throw std::runtime_error("unsupported audio format");
}