123456789101112131415161718192021222324252627 |
- import { Platform } from "@ionic/angular";
- export declare class WebSpeech {
- private platform;
- constructor(platform: Platform);
- /**
- * 语音识别
- * @desc
- * 注意:需要校验说话开始和结束时间2-3秒后,自动结束语音听取
- * @see
- * https://www.jianshu.com/p/e42638839475
- * @param word
- */
- recognition: any;
- startRecognition(words?: string): void;
- /**
- * TTS合成
- * @param sentence:要说的句子
- * @param pitch: 音调,取值范围(0 - 2) 默认值:1
- * @param rate: 语速,取值范围(0.1 - 10) 默认值:1
- * @param volume: 音量,取值范围(0 - 1) 默认值:0.5
- * @see
- * https://zhuanlan.zhihu.com/p/141582231
- */
- speak(sentence: any, pitch?: number, rate?: number, volume?: number): void;
- speakWithEdge(sentence: any, pitch?: number, rate?: number, volume?: number): void;
- getVoiceByName(name: any): SpeechSynthesisVoice;
- }
|