메인 콘텐츠로 바로 가기
백으로 돌아가기
@capgo/capacitor-speech-synthesis
튜토리얼
@capgo/capacitor-speech-synthesis

음성 합성

텍스트에서 음성을 합성하고 언어, 음성,.pitch, 속도 및 음량에 대한 완전한 제어를 제공합니다.

가이드

음성 합성에 대한 튜토리얼

장치에서 테스트

다운로드 Capgo 앱, 그리고 QR code를 스캔하세요.

Speech Synthesis plugin preview QR code

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();

전체 참조

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 세부 정보를 플러그인 추가 또는 업데이트 에서 확인하세요.