feat: use local alert sound instead of broken URL
All checks were successful
Pull Request Check / validate (pull_request) Successful in 23s
All checks were successful
Pull Request Check / validate (pull_request) Successful in 23s
This commit is contained in:
8
App.js
8
App.js
@@ -198,9 +198,15 @@ export default function App() {
|
|||||||
const playSound = async () => {
|
const playSound = async () => {
|
||||||
try {
|
try {
|
||||||
const { sound } = await Audio.Sound.createAsync(
|
const { sound } = await Audio.Sound.createAsync(
|
||||||
{ uri: 'https://shx.reversed.dev/u/mCgT76.mp3' },
|
require('./assets/alert.mp3'),
|
||||||
{ shouldPlay: true, volume: 1.0 }
|
{ shouldPlay: true, volume: 1.0 }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sound.setOnPlaybackStatusUpdate((status) => {
|
||||||
|
if (status.didJustFinish) {
|
||||||
|
sound.unloadAsync();
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error playing sound:', error);
|
console.log('Error playing sound:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
1468
assets/alert.mp3
Normal file
1468
assets/alert.mp3
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user