Esempio n. 1
0
        public CommonSpeechRec(SpeechAppData appData, string format, int devPid)
        {
            _asr = new Asr(appData.appId, appData.apiKey, appData.secretKey);

            this._speechFormat = format;

            this._devPid = devPid;
        }
Esempio n. 2
0
        public SpeechGenerator(SpeechAppData appData, SpeechForamt foramt = SpeechForamt.MP3, TTSParam ttsParam = default(TTSParam))
        {
            switch (foramt)
            {
            case SpeechForamt.WAV:
            case SpeechForamt.PCM:
            case SpeechForamt.AMR:
                throw new NotImplementedException("<Ming> ## Uni Exception ## Cls:SpeechGenerator Func:SpeechGenerator Info: only support mp3");

            case SpeechForamt.MP3:
                _handler = new MP3SpeechGenerator(appData, ttsParam);
                break;
            }
        }
Esempio n. 3
0
        public SpeechRecer(SpeechAppData appData, SpeechForamt format = SpeechForamt.WAV, RecType recType = RecType.ChineseAndSimpleEnglish)
        {
            switch (format)
            {
            case SpeechForamt.WAV:
                _handler = new CommonSpeechRec(appData, "wav", (int)recType);
                break;

            case SpeechForamt.PCM:
                _handler = new CommonSpeechRec(appData, "pcm", (int)recType);
                break;

            case SpeechForamt.AMR:
                _handler = new CommonSpeechRec(appData, "amr", (int)recType);
                break;

            case SpeechForamt.MP3:
                throw new NotImplementedException("<Ming> ## Uni Exception ## Cls:SpeechRecer Func:SpeechRecer Info: don't support mp3");
            }
        }
Esempio n. 4
0
 public MP3SpeechGenerator(SpeechAppData appData, TTSParam ttsParam = default(TTSParam))
 {
     _tts = new Tts(appData.apiKey, appData.secretKey);
 }