| 153 | key != "vevo2.tokenizer_conv_weight_type" && |
| 154 | key != "vevo2.whisper_weight_context_mb" && |
| 155 | key != "vevo2.whisper_graph_context_mb" && |
| 156 | key != "vevo2.whisper_conv_weight_type" && |
| 157 | key != "vevo2.fm_weight_context_mb" && |
| 158 | key != "vevo2.fm_graph_context_mb" && |
| 159 | key != "vevo2.fm_weight_type" && |
| 160 | key != "vevo2.fm_conv_weight_type" && |
| 161 | key != "vevo2.vocoder_weight_context_mb" && |
| 162 | key != "vevo2.vocoder_graph_context_mb" && |
| 163 | key != "vevo2.vocoder_weight_type" && |
| 164 | key != "vevo2.vocoder_conv_weight_type" && |
| 165 | key != "vevo2.weight_type" && |
| 166 | key != "vevo2.whisper_weight_type") { |
| 167 | throw std::runtime_error("unknown Vevo2 session option: " + key); |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | runtime::AudioBuffer make_audio_buffer(int sample_rate, std::vector<float> samples) { |
| 173 | runtime::AudioBuffer out; |
| 174 | out.sample_rate = sample_rate; |
| 175 | out.channels = 1; |
| 176 | out.samples = std::move(samples); |
| 177 | return out; |
| 178 | } |
| 179 | |
| 180 | runtime::AudioBuffer normalize_audio_to_24k_mono(const runtime::AudioBuffer & audio) { |
| 181 | return make_audio_buffer( |
| 182 | 24000, |
| 183 | engine::audio::convert_interleaved_audio_to_mono_linear_resampled( |
| 184 | audio.samples, |
| 185 | audio.sample_rate, |
| 186 | audio.channels, |
| 187 | 24000)); |