feat: allow specifying direct file path in audio.play_stream

This commit is contained in:
MihailRis 2025-03-17 00:40:40 +03:00
parent a0b0c0a9f0
commit b009826d33

View File

@ -66,9 +66,15 @@ inline audio::speakerid_t play_stream(
if (channel == -1) {
return 0;
}
auto paths = scripting::engine->getResPaths();
io::path file;
if (std::strchr(filename, ':')) {
file = std::string(filename);
} else {
auto paths = scripting::engine->getResPaths();
file = paths->find(filename);
}
return audio::play_stream(
paths->find(filename),
file,
glm::vec3(
static_cast<float>(x), static_cast<float>(y), static_cast<float>(z)
),