audio

Coordinates singleton AudioRecorder/AudioContext lifecycle for playback, recording and visualization in React Native audio-api apps.

28|1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/bidah/react-native-hifi --skill audio-bidah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio
Source: https://github.com/bidah/react-native-hifi/tree/main/skills/software-mansion-best-practices/audio
Command: npx skills add https://github.com/bidah/react-native-hifi --skill audio-bidah

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about audio

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent React Native audio context state conflicts and resource leaks during playback?

Prevent React Native audio context conflicts by using singleton AudioContext and AudioRecorder instances, sharing them throughout the app to avoid simultaneous running and suspended instances that cause resource leaks.

What is the best way to manage React Native audio lifecycle sessions for recording and playback?

The best way to manage React Native audio lifecycles is keeping playAndRecord sessions active only when needed and applying strict suspend and close discipline at appropriate lifecycle boundaries to prevent iOS battery drain.

How do I update React Native audio visualizer arrays without causing garbage collection spikes?

Update React Native audio visualizer arrays without garbage collection spikes by modifying shared Float32Array buffers in place via the modify method, avoiding unnecessary data copies during visualization frame updates.

Can I store React Native AudioBuffer state in React state without copying underlying data?

Yes, you can store AudioBuffers in React state or global stores without copying the underlying data, keeping performance predictable across playback and visualization flows in react-native-audio-api scenarios.

Why does my React Native audio playback cause iOS lock screen and battery issues?

React Native audio playback causes iOS lock screen and battery issues when AudioContexts are left running or suspended improperly instead of being actively suspended and closed at appropriate lifecycle boundaries.