I'm trying to get multiple sounds files to play on an Expo-AV, however when one sound plays, the other stops. I can't get more than one sound to play at a time.
What I tried
I tried a class method to create a different instance each time but it didn't work. SO I reverted back to the Functional Component and called playSound() to play at the same time but it doesn't work
Here is my code:
import React, { useEffect, useState } from "react";
import { Text, View} from "react-native";
import {Audio} from 'expo-av'
const MusicModal = (props) => {
  const [sound, setSound] = React.useState(new Audio.Sound());
  const [isPlaying, setIsPlaying] = React.useState(false);
  
  useEffect(()=>{
      handleAudioConfig()
},[])
async function playSound(song) {
  console.log('Loading Sound');
  const { sound } = await Audio.Sound.createAsync(song);
  setSound(sound);
  sound.setIsLoopingAsync(true)
  console.log('Playing Sound');
  await sound.playAsync().then(()=>{
  setIsPlaying(true)
}); 
}
useEffect(() => {
  return sound
    ? () => {
        console.log('Unloading Sound');
        sound.unloadAsync(); 
      }
    : undefined;
}, [sound]);
const handleAudioConfig = async() =>{
  try {
    await Audio.setAudioModeAsync({
      allowsRecordingIOS: false,
      interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
      playsInSilentModeIOS: true,
      interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX,
      shouldDuckAndroid: true,
      staysActiveInBackground: true,
      playThroughEarpieceAndroid: false,
  
    })
    playSound(require('soundFilePath'))
    playSound(require('soundFilePath'))
  } catch (e) {
    console.log(e)
  }  
}
  return (
      <View>
          <Text>Play Sound</Text>
    </View>
  );
};
export default MusicModal;