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

Function audio_duration_sec

tests/perf/model_perf.cpp:317–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317double audio_duration_sec(const engine::runtime::AudioBuffer & audio) {
318 if (audio.sample_rate <= 0 || audio.channels <= 0) {
319 return 0.0;
320 }
321 return static_cast<double>(audio.samples.size()) /
322 static_cast<double>(audio.sample_rate * audio.channels);
323}
324
325double result_duration_sec(
326 const engine::runtime::TaskRequest & request,

Callers 1

result_duration_secFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected