diff --git a/src/sfizz/FilePool.cpp b/src/sfizz/FilePool.cpp index e0bd5a5a..d711e9c5 100644 --- a/src/sfizz/FilePool.cpp +++ b/src/sfizz/FilePool.cpp @@ -108,7 +108,7 @@ absl::optional sfz::FilePool::getFileInformation if (!fs::exists(file)) return {}; - SndfileHandle sndFile(file.c_str()); + SndfileHandle sndFile(file.string().c_str()); if (sndFile.channels() != 1 && sndFile.channels() != 2) { DBG("Missing logic for " << sndFile.channels() << " channels, discarding sample " << filename); return {}; @@ -135,7 +135,7 @@ bool sfz::FilePool::preloadFile(const std::string& filename, uint32_t maxOffset) if (!fs::exists(file)) return false; - SndfileHandle sndFile(file.c_str()); + SndfileHandle sndFile(file.string().c_str()); if (sndFile.channels() != 1 && sndFile.channels() != 2) return false; @@ -198,7 +198,7 @@ void sfz::FilePool::setPreloadSize(uint32_t preloadSize) noexcept const auto numFrames = preloadedFile.second.preloadedData->getNumFrames() / static_cast(oversamplingFactor); const uint32_t maxOffset = numFrames > this->preloadSize ? numFrames - this->preloadSize : 0; fs::path file { rootDirectory / std::string(preloadedFile.first) }; - SndfileHandle sndFile(file.c_str()); + SndfileHandle sndFile(file.string().c_str()); preloadedFile.second.preloadedData = readFromFile(sndFile, preloadSize + maxOffset, oversamplingFactor); } this->preloadSize = preloadSize; @@ -248,7 +248,7 @@ void sfz::FilePool::loadingThread() noexcept [[maybe_unused]] const auto waitDurationMillis = std::chrono::duration(waitDuration).count(); fs::path file { rootDirectory / std::string(promise->filename) }; - SndfileHandle sndFile(file.c_str()); + SndfileHandle sndFile(file.string().c_str()); if (sndFile.error() != 0) { DBG("[sfizz] libsndfile errored for " << promise->filename << " with message " << sndFile.strError()); continue; @@ -328,7 +328,7 @@ void sfz::FilePool::setOversamplingFactor(sfz::Oversampling factor) noexcept const auto numFrames = preloadedFile.second.preloadedData->getNumFrames() / static_cast(this->oversamplingFactor); const uint32_t maxOffset = numFrames > this->preloadSize ? numFrames - this->preloadSize : 0; fs::path file { rootDirectory / std::string(preloadedFile.first) }; - SndfileHandle sndFile(file.c_str()); + SndfileHandle sndFile(file.string().c_str()); preloadedFile.second.preloadedData = readFromFile(sndFile, preloadSize + maxOffset, factor); preloadedFile.second.sampleRate *= samplerateChange; }