MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / add_file

Method add_file

src/framework/assets/resource_bundle.cpp:29–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 : model_root_(std::move(model_root)) {}
28
29void ResourceBundle::add_file(std::string id, const std::filesystem::path & path) {
30 if (id.empty()) {
31 throw std::runtime_error("asset resource id must not be empty");
32 }
33 if (!engine::io::is_existing_file(path)) {
34 throw std::runtime_error("asset resource file does not exist: " + path.string());
35 }
36 auto [it, inserted] = files_.emplace(std::move(id), std::filesystem::weakly_canonical(path));
37 if (!inserted) {
38 throw std::runtime_error("duplicate asset resource id: " + it->first);
39 }
40}
41
42void ResourceBundle::add_tensor_source(std::string id, const std::filesystem::path & path, std::string tensor_prefix) {
43 const auto key = id;

Callers 7

resolve_citrinet_assetsFunction · 0.80
load_citrinet_weightsFunction · 0.80
load_silero_weightsFunction · 0.80
load_roformer_assetsFunction · 0.80
load_pocket_tts_assetsFunction · 0.80
resolve_marblenet_assetsFunction · 0.80
load_marblenet_weightsFunction · 0.80

Calls 2

is_existing_fileFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected