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

패키지 상세v0.7.2

mic_stream

장치 마이크에서 원시 바이트 스트림을 수신하는 플러그인입니다. 오디오는 `Stream` 형식으로 반환됩니다.

AndroidiOSmacOS
30일 다운로드
725
좋아요
99
Pub 점수
130

패키지 설치

flutter pub add mic_stream

패키지 개요

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

mic_stream 패키지는 Dart 스트림을 사용하여 장치 마이크에서 원시 오디오 데이터에 접근하는 간단한 방법을 제공합니다. 실시간 오디오 캡처를 안드로이드, iOS, macOS에서 지원하며, 음성 인식, 사운드 시각화, 라이브 오디오 분석과 같은 저수준 오디오 처리가 필요한 애플리케이션에 적합합니다. 플러그인은 오디오 바이트를 직접 제공하여 개발자가 필요에 따라 인코딩, 필터링 또는 전송을 처리할 수 있게 합니다. Flutter pub add를 통해 최소한의 설정으로 기존 프로젝트에 원활하게 통합할 수 있습니다.

사용 사례

  • 실시간 음성 처리
  • 오디오 시각화
  • 음성 제어 앱
  • 라이브 오디오 스트리밍
  • 사운드 분석

주요 기능

  • 원시 바이트 스트림 출력
  • 크로스 플랫폼 지원 (Android, iOS, macOS)
  • 실시간 오디오 캡처
  • 간단한 스트림 기반 API
  • 경량이며 최소한의 종속성

적합한 대상

  • 음성 분석 도구를 개발하는 개발자
  • 낮은 지연 시간 마이크 입력을 필요로 하는 앱
  • 사용자 정의 오디오 처리를 포함하는 프로젝트
  • 음성 기능을 갖춘 프로토타이핑
  • 모바일 오디오 애플리케이션

고려 사항

  • 모든 플랫폼에서 마이크 권한이 필요합니다
  • 원시 바이트 데이터에 제한됨(내장 디코딩 없음)
  • 추가 오디오 형식 처리가 필요할 수 있습니다
  • 성능은 장치 기능에 따라 달라집니다
  • 일부 플랫폼에서는 백그라운드 오디오 사용이 제한될 수 있습니다

원본 README

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

mic_stream: 0.7.2

[Flutter Plugin] Provides a tool to get the microphone input as 8 or 16 bit PCM Stream. 32 bit and floating point PCM are experimental WIP.

About mic_stream:

As Flutter still lacks some functionality, this plugin aims to provide the possibility to easily get an audio stream from the microphone of mobile devices.

How to use:

The plugin mainly provides one method to provide a raw audio stream:

Stream<UInt8List> MicStream.microphone({options})

and a StreamTransformer to provide a Stream of individual samples (not lists of samples):

MicStream.toSampleStream

that you can use to transform your mic stream:

stream.transform(MicStream.toSampleStream)

Listening to this stream starts the audio recorder while cancelling the subscription stops the stream.

Available options are as follows:

audioSource: AudioSource      // The microphone you want to record from
sampleRate: int               // The amount of data points to record per second
channelConfig: ChannelConfig  // Mono or Stereo
audioFormat: AudioFormat      // 8 bit PCM or 16 bit PCM. Other formats are not yet supported

Some configuration options are platform dependent and can differ from the originally configured ones. You can check the real values using:

Future<int> sampleRate = await MicStream.sampleRate;
Future<int> bitDepth = await MicStream.bitDepth;
Future<int> bufferSize = await MicStream.bufferSize;
Permissions

Make sure you have microphone recording permissions enabled for your project. To do so, add this line to the AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO"/>

In the Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>Microphone access required</string>

You can disable the permission request dialogue by calling MicStream.shouldRequestPermission(false) This will lead to an error if no permission to record audio has been requested, though.

For MacOS:

Open macos/Runner.xcworkspace click Runner -> Signing & Capabilities -> Check "Audio Input"

Example:
// Init a new Stream
Stream<List<int>> stream = await MicStream.microphone(sampleRate: 44100);

// Start listening to the stream
StreamSubscription<List<int>> listener = stream.listen((samples) => print(samples));
// Transform the stream and print each sample individually
stream.transform(MicStream.toSampleStream).listen(print);
// Cancel the subscription
listener.cancel()

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.