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

Function frame_count

src/framework/audio/mixing.cpp:16–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace {
15
16int64_t frame_count(const WavData & audio) {
17 if (audio.channels <= 0) {
18 throw std::runtime_error("audio mix input has invalid channel count");
19 }
20 if (audio.samples.size() % static_cast<size_t>(audio.channels) != 0) {
21 throw std::runtime_error("audio mix input samples are not divisible by channel count");
22 }
23 return static_cast<int64_t>(audio.samples.size() / static_cast<size_t>(audio.channels));
24}
25
26std::vector<float> resample_interleaved_to_rate(
27 const std::vector<float> & samples,

Callers 1

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected