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

Function expanded_json

app/workflow/workflow.cpp:470–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468 if (!path.parent_path().empty()) {
469 std::filesystem::create_directories(path.parent_path());
470 }
471 engine::audio::WavPcm16Sink().write(path, engine::audio::AudioBuffer{
472 audio.sample_rate,
473 audio.channels,
474 audio.samples,
475 });
476}
477
478engine::io::json::Value expanded_json(const engine::io::json::Value & value, const WorkflowContext & context) {
479 if (value.is_string()) {
480 return engine::io::json::Value::make_string(expand_value(value.as_string(), context));
481 }
482 if (value.is_array()) {
483 engine::io::json::Value::Array out;
484 for (const auto & item : value.as_array()) {
485 out.push_back(expanded_json(item, context));
486 }
487 return engine::io::json::Value::make_array(std::move(out));
488 }
489 if (value.is_object()) {
490 engine::io::json::Value::Object out;
491 for (const auto & [key, item] : value.as_object()) {
492 out.emplace(key, expanded_json(item, context));

Callers 3

run_model_step_implFunction · 0.85
run_chunked_model_stepFunction · 0.85
run_model_step_foreachFunction · 0.85

Calls 4

expand_valueFunction · 0.85
is_stringMethod · 0.80
is_arrayMethod · 0.80
is_objectMethod · 0.80

Tested by

no test coverage detected