__CAPGO_KEEP_2__
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-audio-recorder`
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/audio-recorder/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.
설치
설치란bun add @capgo/capacitor-audio-recorderbunx cap syncimport
import란import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';API 개요
API란startRecording
__CAPGO_KEEP_2__ 시작__CAPGO_KEEP_0__
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.startRecording();pauseRecording
녹음 중단녹음 중단을 중지합니다. 안드로이드 (API 24+), iOS, 및 웹에서만 사용할 수 있습니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.pauseRecording();resumeRecording
녹음 재개이전으로 중단된 녹음을 재개합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.resumeRecording();stopRecording
녹음 중단현재 녹음을 중단하고 녹음된 오디오를 영구적으로 저장합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.stopRecording();cancelRecording
녹음 취소녹음 중인 현재 녹음을 취소하고 캡처된 오디오를 폐기합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.cancelRecording();getRecordingStatus
getRecordingStatus현재 녹음 상태를 가져옵니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.getRecordingStatus();getCurrentAmplitude
getCurrentAmplitude현재 입력 음향의 크기를 정규화된 숫자로 반환합니다. [0, 1] 음향 레벨 (마이크 레벨)입니다. 녹음 중인 경우 0.0을 반환합니다.
녹음이 진행 중이지 않으면 0.0을 반환합니다. UI를 위해 60-100ms 간격으로 호출하는 것을 권장합니다. 0 복사
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.getCurrentAmplitude();checkPermissions
권한을 확인합니다.마이크에 대한 접근 권한 상태를 반환합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.checkPermissions();requestPermissions
requestPermissions마이크에 대한 접근 권한을 요청합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.requestPermissions();타입 참조
타입 참조StartRecordingOptions
녹음 시작 옵션.에 의해接受되는 옵션
export interface StartRecordingOptions { /** * The audio session category options for recording. Only available on iOS. * * @since 1.0.0 */ audioSessionCategoryOptions?: AudioSessionCategoryOption[];
/** * The audio session mode for recording. Only available on iOS. * * @since 1.0.0 */ audioSessionMode?: AudioSessionMode;
/** * The audio bit rate in bytes per second. * Only available on Android and iOS. * * @since 1.0.0 */ bitRate?: number;
/** * The audio sample rate in Hz. * Only available on Android and iOS. * * @since 1.0.0 */ sampleRate?: number;}StopRecordingResult
녹음 중지 결과.에 의해 반환되는 결과
export interface StopRecordingResult { /** * The recorded audio as a Blob. Only available on Web. * * @since 1.0.0 */ blob?: Blob;
/** * The duration of the recording in milliseconds. * * @since 1.0.0 */ duration?: number;
/** * The URI pointing to the recorded file. Only available on Android and iOS. * * @since 1.0.0 */ uri?: string;}GetRecordingStatusResult
__CAPGO_KEEP_1____CAPGO_KEEP_2__
export interface GetRecordingStatusResult { /** * The current recording status. * * @since 1.0.0 */ status: RecordingStatus;}GetCurrentAmplitudeResult
__CAPGO_KEEP_1____CAPGO_KEEP_3__
export interface GetCurrentAmplitudeResult { /** * The current input amplitude normalized to the `[0, 1]` range, where `0` * represents silence and `1` represents the maximum level the platform can * report. The value is `0` when no recording is active. * * Note: the source signal differs between platforms — Android reports the * peak sample amplitude since the last call, iOS reports the average power * in dB converted to linear, and Web reports the RMS of the latest frame. * Consumers that need cross-platform parity may want to apply a * per-platform scaling curve. * * @since 8.1.0 */ value: number;}PermissionStatus
__CAPGO_KEEP_4____CAPGO_KEEP_5__
export interface PermissionStatus { /** * The permission state for audio recording. * * @since 1.0.0 */ recordAudio: PermissionState;}RecordingErrorEvent
__CAPGO_KEEP_6____CAPGO_KEEP_7__
export interface RecordingErrorEvent { /** * The error message. * * @since 1.0.0 */ message: string;}RecordingStoppedEvent
__CAPGO_KEEP_1____CAPGO_KEEP_2__
export type RecordingStoppedEvent = StopRecordingResult;AudioSessionCategoryOption
__CAPGO_KEEP_1____CAPGO_KEEP_3__
export enum AudioSessionCategoryOption { AllowAirPlay = 'ALLOW_AIR_PLAY', AllowBluetooth = 'ALLOW_BLUETOOTH', AllowBluetoothA2DP = 'ALLOW_BLUETOOTH_A2DP', DefaultToSpeaker = 'DEFAULT_TO_SPEAKER', DuckOthers = 'DUCK_OTHERS', InterruptSpokenAudioAndMixWithOthers = 'INTERRUPT_SPOKEN_AUDIO_AND_MIX_WITH_OTHERS', MixWithOthers = 'MIX_WITH_OTHERS', OverrideMutedMicrophoneInterruption = 'OVERRIDE_MUTED_MICROPHONE_INTERRUPTION',}AudioSessionMode
__CAPGO_KEEP_1____CAPGO_KEEP_4__
export enum AudioSessionMode { Default = 'DEFAULT', GameChat = 'GAME_CHAT', Measurement = 'MEASUREMENT', SpokenAudio = 'SPOKEN_AUDIO', VideoChat = 'VIDEO_CHAT', VideoRecording = 'VIDEO_RECORDING', VoiceChat = 'VOICE_CHAT',}RecordingStatus
__CAPGO_KEEP_1____CAPGO_KEEP_5__
export enum RecordingStatus { Inactive = 'INACTIVE', Recording = 'RECORDING', Paused = 'PAUSED',}PermissionState
__CAPGO_KEEP_0__ 섹션 제목 ‘허용 상태’Capacitor에서 지원하는 플랫폼 허용 상태.
export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';이 페이지는 플러그인의 src/definitions.tsAPI가 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속하세요.
__CAPGO_KEEP_0__ 섹션 제목 ‘Getting Started에서 계속하세요’__CAPGO_KEEP_0__를 사용하고 있다면 Getting Started native 미디어 및 인터페이스 동작을 계획하기 위해, 그것을 연결하세요. Using @capgo/capacitor-audio-recorder native 기능을 사용하기 위해 Using @capgo/capacitor-audio-recorder Using @capgo/capacitor-live-activities native 기능을 사용하기 위해 Using @capgo/capacitor-live-activities @capgo/capacitor-live-activities @capgo/capacitor-live-activities의 implementation detail Using @capgo/capacitor-video-player native 기능을 사용하기 위해 Using @capgo/capacitor-video-player @capgo/capacitor-video-player @capgo/capacitor-video-player의 implementation detail