Skip to content

feat: encoder - #1183

Open
mdydek wants to merge 18 commits into
mainfrom
feat/encoder-interface
Open

mdydek wants to merge 18 commits into
mainfrom
feat/encoder-interface

Conversation

@mdydek

@mdydek mdydek commented Jul 21, 2026

Copy link
Copy Markdown
Member

Closes #

⚠️ Breaking changes ⚠️

  • recorder.start() no longer takes options
  • fileNamePrefix is renamed to fileName, with different meaning. The new field is the exact file name, with nothing appended.
  • enableFileOutput now rejects names it used to accept. The name must be bare: no extension, no path separators, no .., and at most 128 characters. Violations return an error result from enableFileOutput rather than being passed through.

Introduced changes

  • use system apis instead of ffmpeg to encode recorded buffers
  • abstracted file writers and recorders, there is main c++ class, which only calls native classes, but majority of the implementation can be shared

Proposed architecture:
image

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web
  • Updated old arch android spec file

mdydek and others added 4 commits July 21, 2026 13:19
Resolves conflicts between the encoder work and the OS-APIs decoding
refactor (#1177):
- AudioFileConcatenator: main's decoder-factory WAV path + encoder's
  OS remux (M4A/MP4) path; all FFmpeg remux code removed
- AudioEventHandlerRegistry -> IAudioEventHandlerRegistry (#1212) in
  encoder file writers
- AndroidEncoding/AndroidRemux moved to android/src/main/cpp/audioapi/android/
  to match AndroidDecoding placement
- docs/flags updated: recording and concatAudioFiles are FFmpeg-free

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mdydek mdydek changed the title feat: 1st version of encoder feat: encoder Aug 12, 2026
@closetcaiman closetcaiman added the feature New user-facing features or major capabilities label Aug 12, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

WPT non-regression comparison

PASS — no regressions · 0 improved section(s) · overall 2665 → 2665 (0)

Unchanged sections (28)
Spec section Base pass Head pass Delta
Processing model 0 0 0
Other 52 52 0
AnalyserNode 138 138 0
AudioBuffer 140 140 0
AudioBufferSourceNode 208 208 0
AudioContext 58 58 0
AudioNode 261 261 0
AudioParam 599 599 0
BiquadFilterNode 275 275 0
ChannelMergerNode 30 30 0
ChannelSplitterNode 7 7 0
ConstantSourceNode 59 59 0
ConvolverNode 203 203 0
DelayNode 104 104 0
DestinationNode 0 0 0
DynamicsCompressorNode 4 4 0
GainNode 15 15 0
IIRFilterNode 87 87 0
MediaElementAudioSourceNode 0 0 0
MediaStreamAudioDestinationNode 1 1 0
MediaStreamAudioSourceNode 0 0 0
OfflineAudioContext 35 35 0
OscillatorNode 104 104 0
PannerNode 75 75 0
PeriodicWave 33 33 0
ScriptProcessorNode 0 0 0
StereoPannerNode 102 102 0
WaveShaperNode 75 75 0

Baseline: c08ec4548f55091ac28a4efa97c3222ad3ed08c0 · Candidate: fec7b1f65aeec43e38a0af71288a15ebad82b527

Workflow run · this comment is updated on every push.

@mdydek
mdydek marked this pull request as ready for review August 18, 2026 08:35

@closetcaiman closetcaiman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add description to the PR for fast-access reference to the scope of these changes.

@maciejmakowski2003 maciejmakowski2003 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add an overview of refactor? would be great to get some diagram

Comment on lines +53 to +58
Result<NoneType, std::string> setOnAudioReadyCallback(
float sampleRate,
size_t bufferLength,
int channelCount,
uint64_t callbackId) = 0;
virtual void clearOnAudioReadyCallback() = 0;
uint64_t callbackId);
void clearOnAudioReadyCallback();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo AudioRecorder should know only about a fact that has some side effects like callback or file writer, but not explicitly register them. let's create some abstraction over side effects -> easier to scale and integrate with worklets in future

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to create a stack PR with AudioRecorder rework.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we delegate it to the different pr than here, it is too large anywa

Comment thread packages/react-native-audio-api/ios/audioapi/ios/core/IOSAudioRecorder.h Outdated
@github-actions github-actions Bot added the conflicts This PR has conflicts with the base branch. label Sep 11, 2026
@github-actions github-actions Bot removed the conflicts This PR has conflicts with the base branch. label Sep 14, 2026
@github-actions github-actions Bot added the conflicts This PR has conflicts with the base branch. label Sep 14, 2026
@github-actions github-actions Bot removed the conflicts This PR has conflicts with the base branch. label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New user-facing features or major capabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants