What problem does it solve?
React Native audio features frequently suffer from conflicting AudioContext states, unwanted latency, and resource leaks when contexts, recorders, buffers, and sessions are managed ad hoc; this skill codifies Software Mansion's disciplined best practices so every feature stays stable.
Core Features & Use Cases
- Singleton AudioContext and AudioRecorder: Keep audio lifecycles consistent by instantiating each once and sharing them throughout the app to avoid simultaneous running and suspended instances.
- Safe AudioBuffer state handling: Store AudioBuffers in React state or global stores without copying the underlying data so performance stays predictable across playback and visualization flows.
- Efficient visualizations and sessions: Update shared Visualizer arrays via
modify, keep playAndRecord sessions active only when needed, and suspend/close contexts at the appropriate lifecycle boundaries to prevent iOS lock screen and battery issues.
Quick Start
Ask the agent to verify that the audio feature uses singleton AudioContext/AudioRecorder, shared Float32Array updates, and playAndRecord session handling before implementation begins.