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

Function load_request_audio

tests/miocodec/miocodec_python_warm_bench.py:184–191  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

182 ).eval().to(device)
183
184 def load_request_audio(path: Path) -> torch.Tensor:
185 waveform = load_audio(str(resolve_repo_path(path)), sample_rate=model.config.sample_rate)
186 if args.max_audio_seconds > 0.0:
187 max_samples = int(round(args.max_audio_seconds * model.config.sample_rate))
188 waveform = waveform[:max_samples]
189 if waveform.numel() == 0:
190 raise RuntimeError(f"MioCodec warmbench loaded empty audio: {path}")
191 return waveform.to(device)
192
193 def run_vc_once(source_path: Path, target_path: Path) -> tuple[np.ndarray, int, float]:
194 source = load_request_audio(source_path)

Callers 1

run_vc_onceFunction · 0.85

Calls 2

load_audioFunction · 0.85
resolve_repo_pathFunction · 0.70

Tested by

no test coverage detected