From 4f10466ff30b3ba1cf62d9ed4eb377ca343a6cbd Mon Sep 17 00:00:00 2001 From: amber williams Date: Fri, 4 Aug 2023 17:09:05 +0100 Subject: [PATCH] fix: bell sound path --- modes/timer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modes/timer.js b/modes/timer.js index 3737513..541591c 100644 --- a/modes/timer.js +++ b/modes/timer.js @@ -1,5 +1,11 @@ +import path from "path"; + import player from "./../lib/player.js"; import logger from "./../logger.js"; +import * as utils from "./../utils.js"; + +const { __dirname } = utils.fileDirName(import.meta); +const bellSoundFile = path.join(__dirname, "/../media/bells.mp3"); export const option = "-t, --timer [time unit] [number of units]"; export const optionDef = `Timer mode @@ -13,7 +19,7 @@ time units available: const soundAlarm = () => { player - .play("./media/bells.mp3", (err) => { + .play(bellSoundFile, (err) => { if (err) console.log(`Could not play sound: ${err}`); }) .then(() => {