I am trying to play audio in react native. I tried to install react-native-sound but it did not install. I have installed the library react-native-sound-player. But when I press the play button it shows this error: TypeError: null is not an object (evaluating 'RNSoundPlayer.playSoundFile'). Here is my code:
import SoundPlayer from 'react-native-sound-player';
class myclass extends component {
myfunction () {
SoundPlayer.
YourTexasBenefits('../../assets/audio/filename', 'aac')
}
.....
<Button onPress={() => this.myfunction() }>
Play
</Button>
}
Can anyone help. Thanks.