mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: use sound lib
This commit is contained in:
parent
9fa9f6d85a
commit
39f731352f
2 changed files with 13 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ import { Toast } from "powertoast";
|
|||
import fs from "node:fs";
|
||||
import axios from "axios";
|
||||
import path from "node:path";
|
||||
import sound from "sound-play";
|
||||
|
||||
const getGameIconNativeImage = async (gameId: number) => {
|
||||
try {
|
||||
|
|
@ -100,11 +101,15 @@ export const publishNewAchievementNotification = async (achievement: {
|
|||
title: "New achievement unlocked",
|
||||
message: achievement.displayName,
|
||||
icon: iconPath,
|
||||
sound: true,
|
||||
audio: "ms-appx:///resources/achievement.wav",
|
||||
silent: true,
|
||||
progress: {
|
||||
value: 30,
|
||||
valueOverride: "30/100 achievements",
|
||||
},
|
||||
}).show();
|
||||
|
||||
const audioPath = path.join(app.getAppPath(), "resources", "achievement.wav");
|
||||
|
||||
console.log(audioPath);
|
||||
sound.play(audioPath);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue