#ifndef TTSMANAGER_H
#define TTSMANAGER_H

#include <QString>
#include <QObject>
#include <string>
#include "sherpa-onnx/c-api/c-api.h"

class TTSManager : public QObject {
    Q_OBJECT

public:
    explicit TTSManager(QObject* parent = nullptr);
    ~TTSManager();

    bool initialize();
    bool synthesizeText(const QString& text, int speakerId, const QString& outputPath);
    bool isInitialized() const { return ttsSynthesizer != nullptr; }
    QString getModelType() const;
    bool isMultilingualModel() const;

private:
    void cleanup();

    // TTS相关
    SherpaOnnxOfflineTts* ttsSynthesizer = nullptr;
    SherpaOnnxOfflineTtsConfig ttsConfig;
    std::string ttsModelPathStd;
    std::string ttsLexiconPathStd;
    std::string ttsTokensPathStd;
    std::string ttsDataDirPathStd;
    std::string ttsDictDirPathStd;
    
    QString currentModelPath;
};

#endif // TTSMANAGER_H