2. FTTS SDK features

Implement FTechTTSMangerDelegate

extension ViewController: FTechTTSMangerDelegate {
    func onSuccess(data: TTSResponse) {
    }
    
    func onFailure(error: FTError) {
    }
}

Get language config

  • Get list language config used to tts param

  • When sucess, result is listLanguage, it will be called on onSuccess() in callback

  • When fail, it will called on onFailure() in callback

FTechTTSManager.instance().getLanguageConfig {
    // onSuccess
    } onFailure: { 
    // onFailure
}

Start TTS

  • If isAutoPlayAudio = true, when have result sdk will play audio audioUrl will be return on onSuccess in callback.

  • If isAutoPlayAudio = false, when have result audioUrl will be return on onSuccess in callback.

  • When fails, it will be processed at callback onFailure() in callback.

FTechTTSManager.instance().startTTS(language: language,
                                    voice: voice,
                                    content: content, 
                                    isPlayAudio: true)

Last updated