| 51 | } |
| 52 | |
| 53 | int64_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 | |
| 63 | std::pair<int64_t, int64_t> get_num_wins(int64_t n_frames, int64_t step, const VoiceEncoderConfig & config) { |
| 64 | if (n_frames <= 0) { |
no outgoing calls
no test coverage detected