Skip to content

Getting Started

GitHub

Capgo AI 도구에 다음 명령어를 사용하여 플러그인을 설치할 수 있습니다.

터미널 창
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-recorder
bunx cap sync
import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';

__CAPGO_KEEP_0__ 장치 마이크를 사용하여 음성을 녹음합니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.startRecording();

Pause the ongoing recording. Only available on Android (API 24+), iOS, and Web.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.pauseRecording();

,

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.resumeRecording();

현재 녹음 중지하고 녹음된 오디오를 영구 저장합니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.stopRecording();

cancelRecording

취소 녹음

현재 녹음 중지하고 캡처된 오디오를 폐기합니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.cancelRecording();

getRecordingStatus

녹음 상태 가져오기

현재 녹음 상태를 가져옵니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.getRecordingStatus();

getCurrentAmplitude

현재 진폭 가져오기

마이크 수준을 나타내는 정규화된 숫자를 반환합니다. [0, 1] 녹음 중에 실시간 시각화를 위한 VU 미터 또는 파형과 같은 시각화를 구동하기 위해 사용됩니다.

Returns 0 __CAPGO_KEEP_0__. Designed for UI-rate polling — 60–100 ms interval이 좋은 시작점입니다. tight loop에서 호출하지 마십시오; 각 호출은 JS/native bridge를 건너갑니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.getCurrentAmplitude();

checkPermissions

__CAPGO_KEEP_1__

마이크로폰에 접근하기 위한 현재 권한 상태를 반환합니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.checkPermissions();

requestPermissions

__CAPGO_KEEP_1__

마이크로폰에 접근하기 위한 권한을 요청합니다.

import { CapacitorAudioRecorder } from '@capgo/capacitor-audio-recorder';
await CapacitorAudioRecorder.requestPermissions();

__CAPGO_KEEP_2__

__CAPGO_KEEP_3__

StartRecordingOptions

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__

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

녹음 상태 가져오기 결과

.으로부터 반환되는 결과

export interface GetRecordingStatusResult {
/**
* The current recording status.
*
* @since 1.0.0
*/
status: RecordingStatus;
}

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

권한 상태

.과 .으로부터 반환되는 권한 정보

export interface PermissionStatus {
/**
* The permission state for audio recording.
*
* @since 1.0.0
*/
recordAudio: PermissionState;
}

RecordingErrorEvent

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

export interface RecordingErrorEvent {
/**
* The error message.
*
* @since 1.0.0
*/
message: string;
}

RecordingStoppedEvent

__CAPGO_KEEP_1__

__CAPGO_KEEP_3__

export type RecordingStoppedEvent = StopRecordingResult;

AudioSessionCategoryOption

__CAPGO_KEEP_4__

__CAPGO_KEEP_5__

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_0__

__CAPGO_KEEP_7__

export enum AudioSessionMode {
Default = 'DEFAULT',
GameChat = 'GAME_CHAT',
Measurement = 'MEASUREMENT',
SpokenAudio = 'SPOKEN_AUDIO',
VideoChat = 'VIDEO_CHAT',
VideoRecording = 'VIDEO_RECORDING',
VoiceChat = 'VOICE_CHAT',
}

기록 상태입니다.

export enum RecordingStatus {
Inactive = 'INACTIVE',
Recording = 'RECORDING',
Paused = 'PAUSED',
}

Capacitor에서 지원하는 플랫폼 권한 상태입니다.

export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';

진실의 근원

진실의 근원 섹션

이 페이지는 플러그인의 src/definitions.tsAPI의 공개 버전이 업스트림에서 변경되면 다시 싱크를 실행하세요.

Getting Started에서 계속 진행하세요

Getting Started에서 계속하기

__CAPGO_KEEP_0__에서 __CAPGO_KEEP_1__-audio-recorder를 사용 중이라면 Getting Started __CAPGO_KEEP_0__에서 __CAPGO_KEEP_1__-audio-recorder와 연결하세요 capgo에서 capacitor-audio-recorder의 native 기능을 사용하기 위해 capgo에서 capacitor-live-activities를 사용 중이라면 capgo에서 capacitor-live-activities와 연결하세요 capgo에서 capacitor-live-activities의 native 기능을 사용하기 위해 capgo/capacitor-live-activities capgo에서 capacitor-live-activities의 구현 세부 정보를 위해 capgo에서 capacitor-video-player를 사용 중이라면 capgo에서 capacitor-video-player와 연결하세요 @capgo/capacitor-video-player capgo/capacitor-비디오 플레이어 구현 세부 사항입니다.