2017-05-24 1 views
0

나는 매우 간단한 질문을합니다. 나는 다른 언어로 이야기하고 싶다. 내가 공식 페이지 https://ionicframework.com/docs/native/text-to-speech/#TTSOptions로 확인하지만 사용법 코드 안에 그것을 적용하는 방법에 대한 단서가 없다.이오 네이티브 플러그인 텍스트 음성 말하기

사용법 :

import { TextToSpeech } from '@ionic-native/text-to-speech'; 

constructor(private tts: TextToSpeech) { } 

... 

this.tts.speak('Hello World') 
    .then(() => console.log('Success')) 
    .catch((reason: any) => console.log(reason)); 

여기 내가 사용 코드에 추가 할 수있는 옵션입니다. enter image description here

답변

1

은 그냥 말할 수있는 TTSOptions를 통과() 함수 :

this.tts.speak({ 
    text: "Hello world", 
    locale: "en-US" // Pass any locale you want here. 
}).then(() => console.log('Success')) 
    .catch((reason: any) => console.log(reason)); 
관련 문제