How can i solve this error?
import React from 'react';
import {
StyleSheet,
Text,
View,
TouchableOpacity,
Button,
} from 'react-native';
import {Audio} from 'expo-av';
export default class App extends React.Component {
constructor(props) {
super(props);
this.press = this.press.bind(this);
}
press() {
this.playSound();
}
async playSound() {
const soundObject = new Audio.Sound();
try {
await soundObject.loadAsync(require('./assets/Motherboard.mp3'));
await soundObject.playAsync();
} catch (error) {
alert('An error occurred!')
}
}
render() {
return (
<TouchableOpacity
style={styles.container}
onPress={this.press}
>
<Text>Play</Text>
</TouchableOpacity>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
This is my snacks