MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / loadAudioFile

Method loadAudioFile

src/engine/AudioCache.cpp:158–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158std::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
179bool AudioCache::findInCache(const std::filesystem::path & path, std::shared_ptr<AudioData const> & result)
180{

Callers

nothing calls this directly

Calls 3

warningFunction · 0.85
strcaseequalsFunction · 0.85
readFileMethod · 0.45

Tested by

no test coverage detected