패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.3.0

another_audio_recorder

(Null-Safe + V2) 녹음, 일시정지, 재개, 정지 기능을 지원하며 평균 전력, 피크 전력과 같은 오디오 레벨 측정 속성에 접근할 수 있는 오디오 녹음 플러그인입니다.

AndroidiOS
30일 다운로드
437
좋아요
31
Pub 점수
150

패키지 설치

flutter pub add another_audio_recorder

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Another Audio Recorder는 Android 및 iOS용 null 안전 버전 2의 Flutter 플러그인으로, 녹음 시작, 일시정지, 재개, 중지 등 녹음 라이프사이클에 대한 완전한 제어를 가능하게 합니다. 실시간 오디오 레벨 메터링(평균 및 피크 전력 포함)에 접근할 수 있어 오디오 시각화 또는 품질 모니터링이 필요한 애플리케이션에 적합합니다. 이 플러그인은 가볍고 잘 문서화되어 있으며, 음악, 음성 메모, 팟캐스트 앱에 원활하게 통합될 수 있도록 설계되었습니다.

사용 사례

  • 음성 메모 애플리케이션
  • 오디오 시각화 도구
  • 팟캐스트 녹음 기능
  • 실시간 오디오 레벨 모니터링
  • 음성에서 텍스트로의 전처리

주요 기능

  • 기록/일시정지/재개/정지 지원
  • 실시간 평균 및 피크 전력 측정
  • 널 안전하고 Dart 3과 호환됩니다
  • 크로스 플랫폼(안드로이드 및 iOS)
  • 콜백 이벤트가 있는 간단한 API

적합한 대상

  • 오디오 녹음 앱을 개발하는 개발자
  • 오디오 레벨 피드백이 필요한 앱
  • 정밀한 오디오 제어가 필요한 프로젝트
  • 모바일 플랫폼을 대상으로 하는 Flutter 앱

고려 사항

  • Android 및 iOS에서 런타임 권한이 필요합니다
  • 오디오 녹음에 제한됨—재생 지원 없음
  • 백그라운드 녹음에 대한 추가 처리가 필요할 수 있습니다
  • 플랫폼 고유의 네이티브 코드에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

another_audio_recorder

pub version Awesome Flutter

ko-fi

English | 简体中文

Flutter Audio Record Plugin that supports Record Pause Resume Stop and provide access to audio level metering properties average power peak power

Works for both Android and iOS
Code Samples:

Installation

add another_audio_recorder to your pubspec.yaml

iOS Permission

  1. Add usage description to plist
<key>NSMicrophoneUsageDescription</key>
<string>Can We Use Your Microphone Please</string>
  1. Then use hasPermission api to ask user for permission when needed

Android Permission

  1. Add uses-permission to ./android/app/src/main/AndroidManifest.xml in xml root level like below
    ...
    </application>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    ...
</manifest>
  1. Then use hasPermission api to ask user for permission when needed

Configuration

iOS Deployment Target is 8.0 above
Android
  • AndroidX: use latest version (0.5.x)
  • Legacy Android: use old version (0.4.9)

Usage

Recommended API Usage: hasPermission => init > start -> (pause <-> resume) * n -> stop, call init again before start another recording

Always check permission first(it will request permission if permission has not been set to true/false yet, otherwise it will return the result of recording permission)
bool hasPermission = await AnotherAudioRecorder.hasPermissions;
Initialize (run this before start, so we could check if file with given name already exists)
var recorder = AnotherAudioRecorder("file_path.mp4"); // .wav .aac .m4a
await recorder.initialized;

or

var recorder = AnotherAudioRecorder("file_path", audioFormat: AudioFormat.AAC); // or AudioFormat.WAV
await recorder.initialized;
Sample Rate
var recorder = AnotherAudioRecorder("file_path", audioFormat: AudioFormat.AAC, sampleRate: 22000); // sampleRate is 16000 by default
await recorder.initialized;
Audio Extension and Format Mapping
Audio Format Audio Extension List
AAC .m4a .aac .mp4
WAV .wav
Start recording
await recorder.start();
var recording = await recorder.current(channel: 0);
Get recording details
var current = await recording.current(channel: 0);
// print(current.status);

You could use a timer to access details every 50ms(simply cancel the timer when recording is done)

new Timer.periodic(tick, (Timer t) async {
        var current = await recording.current(channel: 0);
        // print(current.status);
        setState(() {
        });
      });
Recording
Name Description
path String
extension String
duration Duration
audioFormat AudioFormat
metering AudioMetering
status RecordingStatus
Recording.metering
Name Description
peakPower double
averagePower double
isMeteringEnabled bool
Recording.status

Unset,Initialized,Recording,Paused,Stopped

Pause
await recorder.pause();
Resume
await recorder.resume();
Stop (after stop, run init again to create another recording)
var result = await recorder.stop();
File file = widget.localFileSystem.file(result.path);

Example

Please check example app using Xcode.

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Credits

  • This plugin is based on the flutter_audio_recorder, because they stopped updating their plugin and answering/accepting PR's (https://github.com/rmbrone/flutter_audio_recorder)
  • @hnvn - Migrate to Android embedding v2 + Support AAC codec (https://github.com/rmbrone/flutter_audio_recorder/pull/52)
  • @PerrchicK - error handling instead of app crash (https://github.com/rmbrone/flutter_audio_recorder/pull/45/files)

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.