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

Function get_frame_step

src/models/chatterbox/voice_encoder_impl.cpp:53–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53int64_t get_frame_step(const VoiceEncoderConfig & config) {
54 const int64_t frame_step = static_cast<int64_t>(
55 std::llround((static_cast<double>(config.sample_rate) / static_cast<double>(config.partial_rate)) /
56 static_cast<double>(config.partial_frames)));
57 if (frame_step <= 0 || frame_step > config.partial_frames) {
58 throw std::runtime_error("invalid voice encoder frame_step");
59 }
60 return frame_step;
61}
62
63std::pair<int64_t, int64_t> get_num_wins(int64_t n_frames, int64_t step, const VoiceEncoderConfig & config) {
64 if (n_frames <= 0) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected