Search in sources :

Example 1 with MySyntherizer

use of com.ichi2.bd.MySyntherizer in project AnkiChinaAndroid by ankichinateam.

the class AbstractFlashcardViewer method initBDTTs.

private void initBDTTs() {
    appId = Auth.getInstance(this).getAppId();
    appKey = Auth.getInstance(this).getAppKey();
    secretKey = Auth.getInstance(this).getSecretKey();
    // 离线合成SDK必须有此参数;在线合成SDK没有此参数
    sn = Auth.getInstance(this).getSn();
    // 日志打印在logcat中
    LoggerProxy.printable(true);
    String tmpDir = FileUtil.createTmpDir(this);
    // 设置初始化参数
    // 此处可以改为 含有您业务逻辑的SpeechSynthesizerListener的实现类
    SpeechSynthesizerListener listener = new FileSaveListener(mainHandler, tmpDir);
    InitConfig config = getInitConfig(listener);
    // 此处可以改为MySyntherizer 了解调用过程
    synthesizer = new NonBlockSyntherizer(this, config, mainHandler);
    if (!isOnlineSDK) {
        Timber.i("SynthActivity" + "so version:" + SynthesizerTool.getEngineInfo());
    }
}
Also used : SpeechSynthesizerListener(com.baidu.tts.client.SpeechSynthesizerListener) NonBlockSyntherizer(com.ichi2.bd.NonBlockSyntherizer) FileSaveListener(com.ichi2.bd.FileSaveListener) InitConfig(com.ichi2.bd.InitConfig)

Aggregations

SpeechSynthesizerListener (com.baidu.tts.client.SpeechSynthesizerListener)1 FileSaveListener (com.ichi2.bd.FileSaveListener)1 InitConfig (com.ichi2.bd.InitConfig)1 NonBlockSyntherizer (com.ichi2.bd.NonBlockSyntherizer)1