시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함하는 설치 명령어를 복사할 수 있습니다.
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.
설치
설치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-audio-recorder` plugin in my project.만약 Manual Setup을 선호한다면, 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-audio-recorderbunx cap syncImport
Import 섹션import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';API 개요
API 개요 섹션startRecording
녹음 시작장치 마이크를 사용하여 녹음을 시작하세요.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.startRecording();pauseRecording
녹음 중단녹음 중단을 지원하는 Android (API 24+), iOS, Web에서만 사용할 수 있습니다.
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';
const result = await CapacitorAudioRecorder.stopRecording();console.log(result);cancelRecording
취소 녹음현재 녹음 중인 녹음을 취소하고 캡처한 오디오를 폐기합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.cancelRecording();getRecordingStatus
녹음 상태 취득현재 녹음 상태를 가져옵니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
const result = await CapacitorAudioRecorder.getRecordingStatus();console.log(result);getCurrentAmplitude
현재 진폭 가져오기현재 입력 진폭 (마이크 레벨)을 정규화된 숫자로 가져옵니다. (범위) [0, 1] range.
Section titled “getCurrentAmplitude” 0 Section titled “getRecordingStatus”
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
const result = await CapacitorAudioRecorder.getCurrentAmplitude();console.log(result);checkPermissions
권한 확인마이크에 대한 현재 권한 상태를 반환합니다.
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
const result = await CapacitorAudioRecorder.checkPermissions();console.log(result);requestPermissions
권한 요청마이크에 대한 권한 요청
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
const result = await CapacitorAudioRecorder.requestPermissions();console.log(result);타입 참조
타입 참조StartRecordingOptions
녹음 시작 옵션accept() 메서드에 의해 받을 수 있는 옵션
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
GetRecordingStatusResult이 결과는 .
export interface GetRecordingStatusResult { /** * The current recording status. * * @since 1.0.0 */ status: RecordingStatus;}GetCurrentAmplitudeResult
GetCurrentAmplitudeResult이 결과는 .
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
PermissionStatus권한 정보는 및 에 의해 반환됩니다.
export interface PermissionStatus { /** * The permission state for audio recording. * * @since 1.0.0 */ recordAudio: PermissionState;}RecordingErrorEvent
RecordingErrorEvent오디오 녹음 중 오류가 발생할 때 발생하는 이벤트.
export interface RecordingErrorEvent { /** * The error message. * * @since 1.0.0 */ message: string;}RecordingStoppedEvent
녹음이 중단된 이벤트녹음이 완료될 때 발생하는 이벤트.
export type RecordingStoppedEvent = StopRecordingResult;AudioSessionCategoryOption
오디오 세션 카테고리 옵션iOS에서 사용 가능한 오디오 세션 카테고리 옵션.
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
오디오 세션 모드iOS에서 사용 가능한 오디오 세션 모드.
export enum AudioSessionMode { Default = 'DEFAULT', GameChat = 'GAME_CHAT', Measurement = 'MEASUREMENT', SpokenAudio = 'SPOKEN_AUDIO', VideoChat = 'VIDEO_CHAT', VideoRecording = 'VIDEO_RECORDING', VoiceChat = 'VOICE_CHAT',}RecordingStatus
녹음 상태녹음 상태.
export enum RecordingStatus { Inactive = 'INACTIVE', Recording = 'RECORDING', Paused = 'PAUSED',}PermissionState
제목 “권한 상태”Capacitor에서 지원하는 플랫폼 권한 상태.
export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';진실의 근원
제목 “진실의 근원”이 페이지는 플러그인의 src/definitions.ts. upstream에서 변경된 API의 공개 버전을 다시 동기화할 때.
Getting Started에서 계속
제목 “Getting Started에서 계속”Capgo를 사용 중이라면 시작하기 자연스러운 미디어 및 인터페이스 동작을 계획하기 위해 연결하세요. capgo/capacitor 오디오 녹음기 사용 capgo/capacitor 오디오 녹음기 사용 capgo/capacitor 라이브 활동 사용 capgo/capacitor 라이브 활동 사용 capgo/capacitor 라이브 활동 capgo/capacitor 라이브 활동 capgo/capacitor 비디오 플레이어 사용 capgo/capacitor 비디오 플레이어 사용 capgo/capacitor 비디오 플레이어 capgo/capacitor 비디오 플레이어