<commit_before>package danubis.derrick.library.mouth;

import android.content.Context;
import android.media.AudioManager;
import android.os.Bundle;

import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechError;
import com.iflytek.cloud.SpeechSynthesizer;
import com.iflytek.cloud.SynthesizerListener;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import danubis.derrick.library.Avatar;


public class XfMouth extends Mouth {

    private SpeechSynthesizer tts;
    private String language = Avatar.ZH;
    private String gender = Avatar.FEMALE;


    public XfMouth(Context context, String language, String gender) {
        super(context);
        this.language = language;
        this.gender = gender;
        setTTS();
    }

    @Override
    void setTTS() {

        tts = SpeechSynthesizer.createSynthesizer(context, null);

        switch (language) {
            case Avatar.EN:
                switch (gender) {
                    case Avatar.MALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "henry");
                        break;
                    case Avatar.FEMALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "vimary");
                }
                break;
            case Avatar.ZH:
                switch (gender) {
                    case Avatar.MALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "xiaofeng");
                        break;
                    case Avatar.FEMALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "xiaoqi");
                }
                break;
        }

        tts.setParameter(SpeechConstant.SPEED, "90");
        tts.setParameter(SpeechConstant.PITCH, "50");<commit_msg>updated mouth<commit_after>package danubis.derrick.library.mouth;

import android.content.Context;
import android.media.AudioManager;
import android.os.Bundle;

import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechError;
import com.iflytek.cloud.SpeechSynthesizer;
import com.iflytek.cloud.SynthesizerListener;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import danubis.derrick.library.Avatar;


public class XfMouth extends Mouth {

    private SpeechSynthesizer tts;
    private String language = Avatar.ZH;
    private String gender = Avatar.FEMALE;


    public XfMouth(Context context, String language, String gender) {
        super(context);
        this.language = language;
        this.gender = gender;
        setTTS();
    }

    @Override
    void setTTS() {

        tts = SpeechSynthesizer.createSynthesizer(context, null);

        switch (language) {
            case Avatar.EN:
                switch (gender) {
                    case Avatar.MALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "henry");
                        break;
                    case Avatar.FEMALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "vimary");
                }
                break;
            case Avatar.ZH:
                switch (gender) {
                    case Avatar.MALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "xiaofeng");
                        break;
                    case Avatar.FEMALE:
                        tts.setParameter(SpeechConstant.VOICE_NAME, "xiaoqi");
                }
                break;
        }

        tts.setParameter(SpeechConstant.SPEED, "60");
        tts.setParameter(SpeechConstant.PITCH, "60");
{'fraction_non_alphanumeric': 0.08720271800679502, 'fraction_numerical': 0.0022650056625141564, 'mean_word_length': 1.8770358306188926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '262575', 'n_tokens_mistral': 1058, 'n_tokens_neox': 987, 'n_words': 182}