Following is my code and error message, please help.
import React from 'react';
import {StyleSheet, Text, View, Button} from 'react-native';
import { Asset, Audio, Font, Video } from 'expo';
export default class App extends React.Component {
onPressLearnMore = () => {
console.log("this is a test");
const soundObject = new Expo.Audio.Sound();
try {
await soundObject.loadAsync(require('https://www.word.today/uploads/word/pronunciation_audio/727/consistent.mp3'));
await soundObject.playAsync();
// Your sound is playing!
} catch (error) {
// An error occurred!
}
}
render() {
return (
<View style={styles.container}>
<Text>abc</Text>
<Button title="Facebook" color="blue" onPress={this.onPressLearnMore}/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});