Optional playback-only iOS build without microphone APIs

オープン
#1,398 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, ios, objective-c, react-native, swift

調査の方向性

Start by reviewing the attached v0.13.6 patch and the iOS recorder implementations named in the issue: IOSAudioRecorder, NativeAudioRecorder, IOSRecorderCallback, and AudioRecorderHostObject. Trace how the iOS build is configured for CocoaPods, Swift Package Manager, and Expo config plugins, then define and verify the disabled build behavior: playback and synthesis remain available, while recording requests return an unsupported-operation error. The issue reports a working local proof of concept but no comprehensive validation.

索引モデルが issue の本文から書いたものです。

説明

feature-request ios
Feature Request
Problem

Some applications use react-native-audio-api exclusively for audio playback and synthesis, without requiring microphone input or audio recording.

However, the iOS binary still includes recording-related implementations and references to microphone permission APIs, even when the application never uses these features.

This can complicate App Store privacy audits and introduces native functionality that is unnecessary for playback-only applications.

Proposed solution

Introduce an optional build-time configuration to disable audio recording on iOS.

For example:

RNAudioAPI_ENABLE_RECORDING=false

The option would:

  • Exclude iOS recorder implementations from compilation.
  • Remove references to microphone permission request/check APIs from the playback-only build.
  • Preserve audio playback, synthesis, decoding, and the existing audio engine.
  • Return a clear unsupported-operation error if recording is requested.
  • Keep recording enabled by default for full backward compatibility.

Ideally, the configuration would support CocoaPods, Swift Package Manager, and Expo config plugins.

Existing implementation

I maintain a React Native application that uses this library exclusively for synthesized workout audio cues.

For react-native-audio-api 0.13.6, I implemented a local Yarn patch that:

  • Excludes IOSAudioRecorder, NativeAudioRecorder, IOSRecorderCallback, and AudioRecorderHostObject implementations from the iOS CocoaPods build.
  • Removes calls to AVAudioApplication / AVAudioSession microphone permission APIs.
  • Preserves the JSI recorder factory but makes recording attempts fail explicitly.
  • Uses MA_NO_DEVICE_IO=1 for miniaudio while retaining decoding and playback through AVAudioEngine.

The patched version builds and runs on iOS, and audio playback works. This is not yet a comprehensive validation of every audio scenario.

Related implementation patterns

I have implemented optional native build configurations in two other React Native libraries:

react-native-file-hash

https://github.com/Preeternal/react-native-file-hash

Supports build-time engine selection across Android, CocoaPods, SwiftPM, and Expo, compiling and linking only the selected implementation.

react-native-document-scanner-plugin

https://github.com/Preeternal/react-native-document-scanner-plugin

Supports optional Android analysis features through Gradle properties and an Expo config plugin.

Contribution

Would you be interested in supporting an optional playback-only iOS build?

I’ve attached my current Yarn patch against v0.13.6 as a proof of concept. It is application-specific and not intended as a ready-to-merge solution, but it demonstrates the changes needed for a playback-only iOS build. I’m happy to help adapt it into a configurable upstream implementation.

react-native-audio-api-npm-0.13.6-3169d14b69.patch

主要言語
C++
スター
856
フォーク
100
平均マージ
2日 1時間
マージ済み PR(30日)
34

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

software-mansion/react-native-audio-api のほかの issue

software-mansion/react-native-audio-api の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。