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