#pragma once #include "engine/models/index_tts2/types.h" #include #include namespace engine::models::index_tts2 { struct IndexTTS2MelOutput { std::vector values; int64_t channels = 0; int64_t frames = 0; }; struct IndexTTS2FbankOutput { std::vector values; int64_t frames = 0; int64_t dims = 0; }; struct IndexTTS2SemanticFeatureOutput { std::vector values; std::vector attention_mask; int64_t frames = 0; int64_t dims = 0; }; struct IndexTTS2PreparedReferenceAudio { std::vector waveform_16k; std::vector waveform_22k; IndexTTS2MelOutput mel; IndexTTS2FbankOutput campplus_fbank; IndexTTS2SemanticFeatureOutput semantic_features; }; IndexTTS2PreparedReferenceAudio prepare_index_tts2_reference_audio( const std::vector & samples, int sample_rate, int channels, const IndexTTS2S2MelConfig & mel_config, size_t threads, bool speaker_load_semantic = true); IndexTTS2MelOutput compute_index_tts2_mel_spectrogram( const std::vector & waveform, const IndexTTS2S2MelConfig & config, size_t threads); IndexTTS2FbankOutput compute_index_tts2_campplus_fbank_16k(const std::vector & waveform_16k); IndexTTS2SemanticFeatureOutput compute_index_tts2_semantic_features_16k(const std::vector & waveform_16k); } // namespace engine::models::index_tts2