Add native post-processing module for silence removal and pitch-preserving speed adjustment #226
+899
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements offline post-processing for recorded clips: removes silence via audio amplitude analysis and applies pitch-preserving speed adjustment (default 1.15x, configurable 1.0-2.0x). Supports single clip and batch processing.
Implementation
New native module:
modules/video-postprocess/Architecture
Silence detection:
Processing pipeline:
Progress events:
analyzing→removing_silence→adjusting_speed→finalizingAPI
Files
ios/VideoPostprocessModule.swift(417 lines) - Core implementationsrc/VideoPostprocess.types.ts- TypeScript interfacetest/video/RunPostprocessTests.swift(283 lines) - Test suiteREADME.md- API documentationPlatform support: iOS only (Android/Web throw not-implemented errors)
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdp.expo.dev/usr/local/bin/node /home/REDACTED/work/pulse/pulse/node_modules/@expo/cli/build/src/utils/telemetry/clients/flushFetchDetached.js /tmp/415733b71f22cb3e52ebd05828dd72f0/expo-telemetry.json(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Post-processing: Silence Removal + Pitch-Preserving Speed Up for Clips in Pulse (iOS)</issue_title>
<issue_description>### Summary
Add an offline post-processing step for recorded clips in Pulse that:
Applies to a single clip or batch (all clips).
Background / Motivation
The initial PoC records “high-signal” screen content by gating on audio, but it may still leave:
We want a quick post-process pass that:
This is purely an offline process on an existing clip (or a list of clips).
Scope
In scope:
Out of scope (for this ticket):
High-Level Requirements
Post-Processing API
Add a native function (Swift) such as:
Optionally a batch wrapper:
processClips(_ urls: [URL], ...).Silence Removal with Hysteresis
AVAssetReader→ PCM buffers.silent(below threshold).active(above threshold).AVMutableComposition:Speed-Up with Pitch Preservation
speedFactor != 1.0:1 / speedFactor(shorten it).audioTimePitchAlgorithm, e.g.:AVAudioTimePitchAlgorithmSpectralorTimeDomain.AVAudioEngine+AVAudioUnitTimePitch, but for PoC, prefer the simpler composition + export approach.Export
AVAssetExportSessionto a new file:Documents/Processed).React Native Integration
Add a RN native module function:
And optionally:
Wire to a simple UI:
Config / Tuning
silenceThresholdminActiveDurationminSilenceDurationTechnical Notes / Implementation Details
Silence Detection
Hysteresis
Composition Assembly
CMTimeRangefrom original asset’s video and au...💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.