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

Function resolve_voice_state_cache_slots

src/models/pocket_tts/session.cpp:386–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384 + ":" + std::to_string(hash_audio_samples(audio))
385 + (plan.truncate_clone_audio ? ":truncate" : ":full");
386 }
387 return "clone:" + plan.clone_audio_path.string() + (plan.truncate_clone_audio ? ":truncate" : ":full");
388 }
389 throw std::runtime_error("PocketTTS voice state cache key received unknown voice source");
390}
391
392std::size_t resolve_voice_state_cache_slots(const runtime::SessionOptions & options) {
393 const int64_t slots = runtime::parse_i64_option(
394 options.options,
395 {"pocket_tts.voice_state_cache_slots", "voice_state_cache_slots"})
396 .value_or(kDefaultVoiceStateCacheSlots);
397 if (slots < 0) {
398 throw std::runtime_error("pocket_tts.voice_state_cache_slots must be non-negative");
399 }
400 if (static_cast<std::uint64_t>(slots) > static_cast<std::uint64_t>(std::numeric_limits<std::size_t>::max())) {
401 throw std::runtime_error("pocket_tts.voice_state_cache_slots is too large");

Callers 1

PocketTTSSessionMethod · 0.85

Calls 2

parse_i64_optionFunction · 0.85
maxFunction · 0.85

Tested by

no test coverage detected