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

Method run

src/models/pocket_tts/session.cpp:754–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752 if (const auto export_path = runtime::find_option(
753 request.options,
754 {"pocket_tts.export_voice_state_path", "export_voice_state_path"})) {
755 export_voice_state(prepared_session_request_.voice, *export_path);
756 }
757 prepare_generation(prepared_session_request_);
758 mark_prepared();
759}
760
761runtime::TaskResult PocketTTSSession::run(const runtime::TaskRequest & request) {
762 require_prepared("PocketTTS run()");
763 audio_decoder_.clear_runtime_cache();
764 const GenerationRequest generation_request = effective_request_for_run(request);
765 const GenerationResult generated = generate(generation_request);
766 runtime::TaskResult result;
767 result.audio_output = runtime::AudioBuffer{
768 generated.sample_rate,
769 1,
770 generated.audio,
771 };
772 return result;
773}
774
775runtime::StreamingPolicy PocketTTSSession::streaming_policy() const {
776 runtime::StreamingPolicy policy;
777 policy.input = runtime::StreamingInputKind::None;
778 policy.output = runtime::StreamingOutputKind::PullEvents;
779 return policy;

Callers

nothing calls this directly

Calls 2

build_generation_requestFunction · 0.85
resetMethod · 0.45

Tested by

no test coverage detected