class-asr.d.ts 971 B

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