| 100 | auto config = make_voice_clone_config(options); |
| 101 | config.language = normalize_chatterbox_language_code(language); |
| 102 | return config; |
| 103 | } |
| 104 | |
| 105 | ChatterboxVoiceCloneConfig make_voice_clone_config(const runtime::TaskRequest & request) { |
| 106 | return make_voice_clone_config( |
| 107 | request.options, |
| 108 | request.text_input.has_value() ? request.text_input->language : "en"); |
| 109 | } |
| 110 | |
| 111 | bool float_equal(float lhs, float rhs) { |
| 112 | return std::fabs(lhs - rhs) <= 1.0e-6f; |
| 113 | } |
| 114 | |
| 115 | bool same_audio_buffer(const runtime::AudioBuffer & lhs, const runtime::AudioBuffer & rhs) { |
| 116 | return lhs.sample_rate == rhs.sample_rate && |
| 117 | lhs.channels == rhs.channels && |
| 118 | lhs.samples == rhs.samples; |
| 119 | } |
| 120 |
no test coverage detected