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

Function audio_duration_ms

src/models/heartmula/session.cpp:163–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162int64_t audio_duration_ms(const runtime::AudioBuffer & audio) {
163 if (audio.sample_rate <= 0 || audio.channels <= 0 || audio.samples.empty()) {
164 return 0;
165 }
166 const auto frames = static_cast<int64_t>(audio.samples.size()) / audio.channels;
167 return (frames * 1000) / audio.sample_rate;
168}
169
170} // namespace
171
172HeartMuLaSession::HeartMuLaSession(

Callers 1

runMethod · 0.70

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected