React Native Audio Pro

A React Native module for robust audio playback from remote URLs, live streams, and local files. Ideal for music, audiobook, podcast, and streaming apps. Works on iOS and Android.

npm version Website GitHub Repo

๐Ÿš€ Features

๐ŸŽง React Hook in Action

import { useAudioPro } from 'react-native-audio-pro';

export default function Player() {
  const { state, duration, position, ...etc } = useAudioPro();
  return (
    <View>
      <Text>State: {state}</Text>
      <Text>Position: {position} / {duration}</Text>
    </View>
  );
}

๐Ÿงฉ Module in Action

import {AudioPro} from 'react-native-audio-pro';

AudioPro.configure({ contentType: 'speech' });

const track = {
  id: 'track-001',
  url: 'https://example.com/audio-book.mp3'
  title: 'The Best Book Ever',
  artwork: 'https://example.com/nice-picture.jpg',
};

AudioPro.play(track);
// or
AudioPro.play(track, {
  autoPlay: false,
  headers: {
    audio: { 'Authorization': 'Bearer token123' },
    artwork: { 'Cache-Control': 'max-age=3600' }
  }
});

๐Ÿ”Š Ambient Audio

Aan isolated ambient audio system for playing background sounds independently from the main player.

import { AudioPro } from 'react-native-audio-pro';

AudioPro.ambientPlay({
  url: 'https://example.com/nature-sounds.mp3',
  loop: true,
});

AudioPro.ambientStop();

AudioPro.ambientSetVolume(0.5);

Documentation

For full setup and API reference, see the GitHub README.

๐Ÿš€ Ready to build?

Check it out and let us know how you go! If you run into any issues, log an issue โ€” weโ€™ll squash bugs fast. ๐Ÿ’ช