vokhuyetOz / react-native-concurrent-sound

React Native module for playing multiple local, remote sound at same time
https://www.npmjs.com/package/@vokhuyet/react-native-concurrent-sound
MIT License
6 stars 0 forks source link

How do I load a local audio file? #1

Open kierancrown opened 3 months ago

kierancrown commented 3 months ago

The documentation mentions that files can be loaded from either a http or file url. I've not been able to load local files successful and the example doesn't seem to show how to achieve this?

vokhuyetOz commented 3 months ago

how do you get file? from document picker? which platform was you using? (android or ios)

vokhuyetOz commented 3 months ago

it should be

 await load({
      uri: `file://{audio.fileUrl}`,
      key: audio.fileUrl,
      volume: audio.volume / 100,
      loop: false,
  });
play({
 uri: `file://${audio.fileUrl}`,
 key: audio.fileUrl,
})