Using @capgo/capacitor-speech-synthesis
speech synthesis plugin
Install
bun add @capgo/capacitor-speech-synthesis
bunx cap sync
What This Plugin Exposes
speak- __CAPGO_KEEP_2__를 지정된 옵션으로 말합니다. 음성 큐에 발언이 추가됩니다.synthesizeToFile- __CAPGO_KEEP_2__를 Android/iOS에서 오디오 파일로 합성하고, 오디오 파일의 경로를 반환합니다.cancel- 음성 큐에 있는 모든 발언을 취소하고 현재 음성을 중지합니다.pause- 음성을 즉시 중지합니다.
Example Usage
speak
__CAPGO_KEEP_2__를 지정된 옵션으로 말합니다. 음성 큐에 발언이 추가됩니다.
import { SpeechSynthesis } from '@capgo/capacitor-speech-synthesis';
const result = await SpeechSynthesis.speak({
text: 'Hello, world!',
language: 'en-US',
rate: 1.0,
pitch: 1.0,
volume: 1.0,
queueStrategy: 'Add'
});
console.log('Utterance ID:', result.utteranceId);
synthesizeToFile
음성 합성을 위한 오디오 파일로 변환 (Android/iOS만 지원). 오디오 파일이 저장된 파일 경로를 반환합니다.
import { SpeechSynthesis } from '@capgo/capacitor-speech-synthesis';
const result = await SpeechSynthesis.synthesizeToFile({
text: 'Hello, world!',
language: 'en-US'
});
console.log('Audio file saved at:', result.filePath);
cancel
모든 대기 중의 발화와 현재의 음성 출력을 취소합니다.
import { SpeechSynthesis } from '@capgo/capacitor-speech-synthesis';
await SpeechSynthesis.cancel();
pause
음성 출력을 즉시 중지합니다.
import { SpeechSynthesis } from '@capgo/capacitor-speech-synthesis';
await SpeechSynthesis.pause();
전체 참조
- GitHub: https://github.com/Cap-go/capacitor-speech-synthesis/
- 문서: /docs/plugins/speech-synthesis/
Using @capgo/capacitor-speech-synthesis
이 기능을 사용 중이라면 Using @capgo/capacitor-speech-synthesis 자연 플러그인 작업을 계획하고자 할 때, 이 기능을 @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-speech-synthesis와 연결하세요. 이 기능을 사용 중이라면 @capgo/capacitor-speech-synthesis implementation 세부 정보를 @capgo/capacitor-speech-synthesis 에서 찾으세요. Getting Started implementation 세부 정보를 Getting Started 에서 찾으세요. Capgo 플러그인 디렉토리 제품 워크플로우를 Capgo 플러그인 디렉토리 에서 확인하세요. Capacitor 플러그인들에 대해 Capgo 에서 확인하세요. implementation 세부 정보를 Capacitor 플러그인들에 대해 Capgo 에서 확인하세요. 플러그인 추가 또는 업데이트 implementation 세부 정보를 플러그인 추가 또는 업데이트 에서 확인하세요.