You are an expert software architect and senior full-stack mobile developer. Your task is to design and implement a React Native application that can broadcast live audio from a mobile device (Android + iOS) to an Icecast server.
Requirements
-
Cross-Platform
-
Audio Capture & Encoding
-
Capture microphone input in real time (PCM).
-
Encode audio into MP3 (libmp3lame) and Opus (libopus) using ffmpeg-kit-react-native.
-
Support configurable bitrate, codec, and sample rate.
-
Streaming to Icecast
-
Stream live encoded audio to Icecast via icecast://source:password@host:port/mount.
-
Ensure low latency using pipe:0 input, with fallback to file-segment streaming if needed.
-
Implement auto-reconnect with exponential backoff when the network drops.
-
User Interface
-
Permissions
-
CI/CD
-
Testing
-
Jest unit tests for UI + state.
-
Integration test to simulate encoder pipeline with PCM test data.
-
Add mocks for ffmpeg commands to validate correctness.
-
Documentation
-
Clear README.md with build/run instructions.
-
ARCHITECTURE.md explaining audio pipeline, reconnect logic, and native module design.
Deliverables