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

Method run

src/framework/modules/hift_vocoder.cpp:592–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590 }
591
592 std::vector<float> run(const std::vector<float> & mel, int64_t frames) {
593 if (frames != capacity_frames_) {
594 throw std::runtime_error("HiFT F0 graph frame mismatch");
595 }
596 ggml_backend_tensor_set(input_, mel.data(), 0, mel.size() * sizeof(float));
597 if (engine::core::compute_backend_graph(weights_->execution_context->backend(), graph_) != GGML_STATUS_SUCCESS) {
598 throw std::runtime_error("ggml_backend_graph_compute failed for HiFT F0 predictor");
599 }
600 auto raw = core::read_tensor_f32(output_);
601 std::vector<float> f0(static_cast<size_t>(frames), 0.0F);
602 for (int64_t t = 0; t < frames; ++t) {
603 f0[static_cast<size_t>(t)] = raw[static_cast<size_t>(t)];
604 }
605 return f0;
606 }
607
608private:
609 const HiftVocoderWeights * weights_ = nullptr;

Callers 3

runMethod · 0.45
predict_f0_lockedMethod · 0.45
synthesizeMethod · 0.45

Calls 6

ggml_backend_tensor_setFunction · 0.85
compute_backend_graphFunction · 0.85
read_tensor_f32Function · 0.85
dataMethod · 0.45
sizeMethod · 0.45
backendMethod · 0.45

Tested by

no test coverage detected