| 156 | } |
| 157 | |
| 158 | std::shared_ptr<AudioData const> AudioCache::loadAudioFile (const std::filesystem::path & path) |
| 159 | { |
| 160 | |
| 161 | std::shared_ptr<vfs::IBlob> blob = m_fs->readFile(path); |
| 162 | if (!blob) |
| 163 | { |
| 164 | log::warning("Couldn't read audio file `%s`", path.generic_string().c_str()); |
| 165 | return nullptr; |
| 166 | } |
| 167 | |
| 168 | auto extension = path.extension(); |
| 169 | if (strcaseequals(extension.generic_string(), ".wav")) |
| 170 | { |
| 171 | return importRiff(blob, path.generic_string().c_str()); |
| 172 | } |
| 173 | else |
| 174 | log::warning("Unsupported audio format `%s` for file `%s`", extension.c_str()); |
| 175 | |
| 176 | return nullptr; |
| 177 | } |
| 178 | |
| 179 | bool AudioCache::findInCache(const std::filesystem::path & path, std::shared_ptr<AudioData const> & result) |
| 180 | { |
nothing calls this directly
no test coverage detected