wav files streaming

This commit is contained in:
MihailRis
2024-03-01 14:08:13 +03:00
parent cc9a3e3ec8
commit 7c51e39dfe
3 changed files with 122 additions and 6 deletions
+3 -1
View File
@@ -121,7 +121,9 @@ Sound* audio::createSound(std::shared_ptr<PCM> pcm, bool keepPCM) {
PCMStream* audio::openPCMStream(const fs::path& file) {
std::string ext = file.extension().u8string();
if (ext == ".ogg" || ext == ".OGG") {
if (ext == ".wav" || ext == ".WAV") {
return wav::create_stream(file);
} else if (ext == ".ogg" || ext == ".OGG") {
return ogg::create_stream(file);
}
throw std::runtime_error("unsupported audio stream format");