diff --git a/App.js b/App.js index 8f0034f..c99148b 100644 --- a/App.js +++ b/App.js @@ -198,9 +198,15 @@ export default function App() { const playSound = async () => { try { const { sound } = await Audio.Sound.createAsync( - { uri: 'https://shx.reversed.dev/u/mCgT76.mp3' }, + require('./assets/alert.mp3'), { shouldPlay: true, volume: 1.0 } ); + + sound.setOnPlaybackStatusUpdate((status) => { + if (status.didJustFinish) { + sound.unloadAsync(); + } + }); } catch (error) { console.log('Error playing sound:', error); } diff --git a/assets/alert.mp3 b/assets/alert.mp3 new file mode 100644 index 0000000..a435783 --- /dev/null +++ b/assets/alert.mp3 @@ -0,0 +1,1468 @@ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +