Getting Started
이 플러그인을 설치하는 방법과 전체 마크다운 가이드를 포함한 설치 설정을 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-speech-recognition`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/speech-recognition/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 다음 명령어를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-speech-recognition` plugin in my project.만약 Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-speech-recognitionbunx cap syncImport
Import 섹션import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';API 개요
API 개요 섹션available
사용 가능한 섹션__CAPGO_KEEP_0__
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.available();isOnDeviceRecognitionAvailable
__CAPGO_KEEP_0____CAPGO_KEEP_0__
__CAPGO_KEEP_0__ useOnDeviceRecognition__CAPGO_KEEP_0__ true __CAPGO_KEEP_0__
__CAPGO_KEEP_0__ false __CAPGO_KEEP_0__
SDK __CAPGO_KEEP_0__ __CAPGO_KEEP_0__ 음성 인식기
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.isOnDeviceRecognitionAvailable();start
시작음성을 녹음하고 음성 인식을 시작합니다.
만약 partialResults 이 true, 반환된 promise는 즉시 해결되고 업데이트는 세션 종료까지 partialResults 리스너를 통해 스트리밍됩니다.
기본 경로는 이전 버전의 인식기 동작을 유지하기 위해 뒤로 호환성을 유지합니다.
만약 useOnDeviceRecognition: true 이전
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.start();stop
종료음성 인식이 중단되고 네이티브 리소스가 해제됩니다.
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.stop();forceStop
강제 중단현재 세션을 강제로 중단합니다.
안드로이드에서는 일반적인 중단 시도를 먼저하고, 이후 destroy/recreate로 fallback합니다. timeout.
iOS에서는 현재 세션을 즉시 중단합니다.
부분 전사록이 캐시되어 있다면, partialResults listener forced: true.
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.forceStop();getLastPartialResult
마지막 캐시된 부분 전사록 결과를 가져옵니다.클립보드에 복사
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.getLastPartialResult();setPTTState
PTT 상태 설정현재 푸시-투-톡 버튼 상태를 업데이트합니다.
이 기능을 사용하여 continuousPTT 또는 사용자 정의 홀드-투-톡 흐름과 함께 사용하세요.
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.setPTTState({} as PTTStateOptions);getSupportedLanguages
지원하는 언어 목록을 가져옵니다.Android 13 이상 장치에서는 이 목록을 노출하지 않습니다. 그 경우
빈 목록입니다. languages 클립보드에 복사
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.getSupportedLanguages();isListening
클립보드에 복사PTT 상태 설정
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.isListening();checkPermissions
권한 확인현재 권한 상태를 가져옵니다.
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.checkPermissions();requestPermissions
권한 요청마이크 + 음성 인식 권한을 요청합니다.
import { SpeechRecognition } from '@capgo/capacitor-speech-recognition';
await SpeechRecognition.requestPermissions();SpeechRecognitionAvailability
복사export interface SpeechRecognitionAvailability { available: boolean;}SpeechRecognitionStartOptions
SpeechRecognitionAvailability인식기 동작을 호출할 때 어떻게 행동할지 설정합니다.
export interface SpeechRecognitionStartOptions { /** * Locale identifier such as `en-US`. When omitted the device language is used. */ language?: string; /** * Maximum number of final matches returned by native APIs. Defaults to `5`. */ maxResults?: number; /** * Prompt message shown inside the Android system dialog (ignored on iOS). */ prompt?: string; /** * When `true`, Android shows the OS speech dialog instead of running inline recognition. * Defaults to `false`. */ popup?: boolean; /** * Emits partial transcription updates through the `partialResults` listener while audio is captured. */ partialResults?: boolean; /** * Enables native punctuation handling where supported (iOS 16+). */ addPunctuation?: boolean; /** * Opt in to the platform's newer on-device recognition path when available. * * On iOS 26+, this uses Apple's `SpeechAnalyzer` / `SpeechTranscriber` pipeline. * On recent Android versions, this uses the on-device `SpeechRecognizer` path. * * It is intentionally opt-in so existing apps keep the legacy flow unless they choose * to roll out the new behavior. * * Use {@link SpeechRecognitionPlugin.isOnDeviceRecognitionAvailable} before enabling it in production. * * Platform SDK docs: * iOS: [Speech](https://developer.apple.com/documentation/speech), * [SpeechAnalyzer](https://developer.apple.com/documentation/speech/speechanalyzer), * [SpeechTranscriber](https://developer.apple.com/documentation/speech/speechtranscriber) * Android: [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer) * * Defaults to `false`. */ useOnDeviceRecognition?: boolean; /** * Allow a number of milliseconds of silence before splitting the recognition session into segments. * Required to be greater than zero and currently supported on Android only. */ allowForSilence?: number; /** * EXPERIMENTAL: Keep a PTT session alive across silence by restarting recognition while the button stays held. * * This restart behavior is implemented for Android inline recognition and iOS native recognition. */ continuousPTT?: boolean;}SpeechRecognitionMatches
SpeechRecognitionMatchesexport interface SpeechRecognitionMatches { matches?: string[];}ForceStopOptions
ForceStopOptions. 옵션
export interface ForceStopOptions { /** * Android only: timeout in milliseconds before forcing stop via destroy/recreate. * * On iOS, the current session is stopped immediately and this value is ignored. * * Defaults to `1500`. */ timeout?: number;}LastPartialResult
LastPartialResult. 결과
export interface LastPartialResult { /** * Whether a partial result is currently cached. */ available: boolean; /** * The most recent transcript text known to the native recognizer. */ text: string; /** * All current match alternatives when available. */ matches?: string[];}PTTStateOptions
PTTStateOptions. 옵션
export interface PTTStateOptions { /** * Whether the PTT button is currently held. */ held: boolean;}SpeechRecognitionLanguages
SpeechRecognitionLanguages 섹션export interface SpeechRecognitionLanguages { languages: string[];}SpeechRecognitionListening
SpeechRecognitionListening 섹션export interface SpeechRecognitionListening { listening: boolean;}SpeechRecognitionPermissionStatus
SpeechRecognitionPermissionStatus 섹션권한 맵 checkPermissions 그리고 requestPermissions.
export interface SpeechRecognitionPermissionStatus { speechRecognition: PermissionState;}SpeechRecognitionSegmentResultEvent
SpeechRecognitionSegmentResultEvent 섹션분할 결과가 생성될 때 발생하는 이벤트 (Android 전용)
export interface SpeechRecognitionSegmentResultEvent { matches: string[];}SpeechRecognitionPartialResultEvent
음성 인식 부분 결과 이벤트부분 음성 인식이 생성될 때 발생합니다.
export interface SpeechRecognitionPartialResultEvent { /** * Current recognition matches when the native recognizer reports them. * * This can be omitted for forced or accumulated-only payloads. */ matches?: string[]; /** * Accumulated transcription from earlier continuous PTT cycles. */ accumulated?: string; /** * Final accumulated text including the current result. */ accumulatedText?: string; /** * `true` when the plugin is restarting recognition inside a continuous PTT session. */ isRestarting?: boolean; /** * `true` when the payload was emitted by `forceStop()`. */ forced?: boolean;}SpeechRecognitionListeningEvent
음성 인식 듣기 이벤트음성 인식 상태가 변경될 때 발생합니다.
export interface SpeechRecognitionListeningEvent { /** * Finite state of the recognition session. */ state?: ListeningFiniteState; /** * Unique identifier for the current listening session. */ sessionId?: number; /** * Why this state transition occurred. */ reason?: ListeningReason; /** * Error code when the transition is caused by an error. */ errorCode?: string; /** * Backward-compatible binary state used by earlier releases. */ status?: 'started' | 'stopped';}실질적 출처
이 페이지는 플러그인의공개 __CAPGO_KEEP_0__이 업스트림에서 변경될 때 다시 싱크를 실행하세요. src/definitions.ts. Re-run the sync when the public API changes upstream.
시작부터 계속
시작부터 계속만약에 사용 중이라면 시작하기 계획 대시보드 및 API 작업을 계획하고 싶다면 Using @capgo/capacitor-speech-recognition Using @capgo/capacitor-speech-recognition API 개요 API 개요 소개 __CAPGO_KEEP_0__ 키 API 키 for the implementation detail in API Keys, and Devices 장치에 대한 구현 세부 정보.