| 940 | |
| 941 | void run_mix_audio_step( |
| 942 | const engine::io::json::Value & step, |
| 943 | WorkflowContext & context) { |
| 944 | const std::string id = workflow_string(step, "id"); |
| 945 | const auto * inputs_value = step.find("inputs"); |
| 946 | if (inputs_value == nullptr || !inputs_value->is_array()) { |
| 947 | throw std::runtime_error("mix_audio step requires inputs array: " + id); |
| 948 | } |
| 949 | std::vector<engine::audio::AudioMixInput> inputs; |
| 950 | for (const auto & item : inputs_value->as_array()) { |
| 951 | engine::audio::AudioMixInput input; |
| 952 | input.audio = engine::audio::read_wav_f32(resolve_workflow_path(workflow_string(item, "path"), context)); |
| 953 | input.gain = static_cast<float>(workflow_optional_number(item, "gain").value_or(1.0)); |
| 954 | if (const auto activity_ref = workflow_optional_string(item, "activity_ref")) { |
| 955 | input.activity_reference = engine::audio::read_wav_f32(resolve_workflow_path(*activity_ref, context)); |
| 956 | input.activity_threshold_dbfs = |
no test coverage detected