Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/afkcodes/react-native-audio-pro/llms.txt

Use this file to discover all available pages before exploring further.

The equalizer and bass boost APIs give you direct control over the native Android audio effects engine. Use them to tune the frequency response for different listening environments, headphone types, or music genres. Both features are powered by Android’s built-in Equalizer and BassBoost audio effects and apply to the currently active audio session.
Equalizer and bass boost are Android-only. These methods have no effect on iOS. If you need to apply EQ on iOS, consider a third-party DSP library.

Equalizer

setEqualizer(gains)

Sets the gain for each of the 10 frequency bands. Call this at any time during playback — changes are applied immediately.
ParameterTypeDescription
gainsnumber[]Array of exactly 10 gain values in dB. Typically in the range of -10 to +10
import { AudioPro } from 'react-native-audio-pro';

// Boost bass and treble, slightly cut the mids
const gains = [4, 3, 1, -1, -2, -1, 0, 2, 4, 5];
AudioPro.setEqualizer(gains);

The 10 Bands

The EQUALIZER_BANDS constant maps each array index to its center frequency. Use it to build dynamic UIs or label your sliders correctly.
import { EQUALIZER_BANDS } from 'react-native-audio-pro';

// EQUALIZER_BANDS[0] → { frequency: 31,    label: '31Hz'  }
// EQUALIZER_BANDS[1] → { frequency: 63,    label: '63Hz'  }
// EQUALIZER_BANDS[2] → { frequency: 125,   label: '125Hz' }
// EQUALIZER_BANDS[3] → { frequency: 250,   label: '250Hz' }
// EQUALIZER_BANDS[4] → { frequency: 500,   label: '500Hz' }
// EQUALIZER_BANDS[5] → { frequency: 1000,  label: '1kHz'  }
// EQUALIZER_BANDS[6] → { frequency: 2000,  label: '2kHz'  }
// EQUALIZER_BANDS[7] → { frequency: 4000,  label: '4kHz'  }
// EQUALIZER_BANDS[8] → { frequency: 8000,  label: '8kHz'  }
// EQUALIZER_BANDS[9] → { frequency: 16000, label: '16kHz' }

Building a Custom EQ UI

Use EQUALIZER_BANDS to render a labeled slider for each band and apply all gains together whenever any slider changes:
import { useState } from 'react';
import { View, Text } from 'react-native';
import Slider from '@react-native-community/slider';
import { AudioPro, EQUALIZER_BANDS } from 'react-native-audio-pro';

export function EqualizerUI() {
  const [gains, setGains] = useState<number[]>(
    new Array(EQUALIZER_BANDS.length).fill(0)
  );

  function handleBandChange(index: number, value: number) {
    const updated = [...gains];
    updated[index] = value;
    setGains(updated);
    AudioPro.setEqualizer(updated);
  }

  return (
    <View>
      {EQUALIZER_BANDS.map((band, index) => (
        <View key={band.frequency}>
          <Text>{band.label}</Text>
          <Slider
            minimumValue={-10}
            maximumValue={10}
            value={gains[index]}
            onValueChange={(val) => handleBandChange(index, val)}
          />
          <Text>{gains[index]?.toFixed(1)} dB</Text>
        </View>
      ))}
    </View>
  );
}

Bass Boost

setBassBoost(strength)

Applies a low-frequency bass boost effect independently of the equalizer. The strength is expressed as an integer from 0 (no boost) to 1000 (maximum boost).
ParameterTypeDescription
strengthnumberBass boost strength from 0 to 1000. 500 = 50% strength
import { AudioPro } from 'react-native-audio-pro';

AudioPro.setBassBoost(500); // 50% strength
AudioPro.setBassBoost(0);   // Disabled

Using Presets

React Native Audio Pro ships two sets of presets that you can apply directly without calculating gains manually.

Standard Presets

EQUALIZER_PRESETS contains 19 genre and device-tuned presets:
Preset NameID
Defaultdefault
Clubclub
Livelive
PartyParty
Poppop
Softsoft
Skaska
Reggaereggae
Rockrock
Dancedance
Technotechno
Headphonesheadphones
Soft rocksoft_rock
Classicalclassical
Large Halllarge_hall
Full Bassfull_base
Full Treblefull_treble
Laptop Speakerslaptop_speakers
Full Bass & Treblebass_treble

Advanced Presets

EQUALIZER_ADVANCED_PRESETS contains a wider selection of carefully described presets optimized for specific use cases:
Preset NameIDDescription
Vocal Clarityadv-vocal-clarityEnhanced mid-range for crystal clear vocals
Bass Boostadv-bass-boostStrong low-frequency enhancement for bass impact
Studio Monitoradv-studio-monitorProfessional reference tuning for accurate monitoring
Audiophileadv-audiophileRefined and balanced sound for critical listening
Headphonesadv-headphonesOptimized for over-ear and on-ear headphones
Earbudsadv-earbudsTuned for in-ear monitors and earbuds
Jazzadv-jazzRich and warm tone emphasizing acoustic instruments
Hip-Hopadv-hip-hopDeep bass with crisp highs for impact
Electronicadv-electronicEnhanced low-end and sparkling highs
Live Concertadv-live-concertRecreates live venue atmosphere with enhanced presence
Midnight Modeadv-midnight-modeCompressed dynamic range for late-night listening
Warm Analogadv-warm-analogRich vintage warmth with analog character
Deep Impactadv-deep-impactStrong low-end extension for cinematic impact

Applying a Preset

Find a preset by its id and pass its gains array directly to setEqualizer:
import { AudioPro, EQUALIZER_PRESETS } from 'react-native-audio-pro';

const preset = EQUALIZER_PRESETS.find((p) => p.id === 'rock');
if (preset) {
  AudioPro.setEqualizer(preset.gains);
}
The same pattern works for EQUALIZER_ADVANCED_PRESETS:
import { AudioPro, EQUALIZER_ADVANCED_PRESETS } from 'react-native-audio-pro';

const preset = EQUALIZER_ADVANCED_PRESETS.find((p) => p.id === 'adv-vocal-clarity');
if (preset) {
  AudioPro.setEqualizer(preset.gains);
}

Preset Selector Example

This pattern is directly taken from the example app — render preset buttons and apply the chosen preset on press:
import { useState } from 'react';
import { AudioPro, EQUALIZER_PRESETS } from 'react-native-audio-pro';

export function PresetSelector() {
  const [selectedId, setSelectedId] = useState('default');

  function handleSelect(id: string) {
    const preset = EQUALIZER_PRESETS.find((p) => p.id === id);
    if (preset) {
      AudioPro.setEqualizer(preset.gains);
      setSelectedId(id);
    }
  }

  return (
    <>
      {EQUALIZER_PRESETS.map((preset) => (
        <button
          key={preset.id}
          onClick={() => handleSelect(preset.id)}
          style={{ fontWeight: selectedId === preset.id ? 'bold' : 'normal' }}
        >
          {preset.name}
        </button>
      ))}
    </>
  );
}

Import Reference

All equalizer constants are exported directly from the package:
import {
  EQUALIZER_BANDS,
  EQUALIZER_PRESETS,
  EQUALIZER_ADVANCED_PRESETS,
  AudioPro,
} from 'react-native-audio-pro';

Build docs developers (and LLMs) love