i2van / hourglass

The simple countdown timer for Windows.
MIT License
28 stars 5 forks source link

can't make --sound work #16

Closed rsyqvthv closed 1 month ago

rsyqvthv commented 1 month ago

I am using portable version..

I download zip, unpack to the folder hourglass, followed by run ngen-Hourglass.bat install. then I put a wav file alarm.wav in the hourglass,

I tested using this command to start a 1 minute timer: Hourglass.exe --sound alarm 1, it's no sound when timer expired.

I've tried make a Sounds folder, and put alarm.wav in, same result.. and also tested mp3, aac, m4a, also didn't work.

what am I doing wrong?

i2van commented 1 month ago

Please run

ngen-Hourglass.bat uninstall

It should work after that. I'll fix it in next version.

i2van commented 1 month ago

@rsyqvthv You can download fix here

rsyqvthv commented 1 month ago

Thanks for your prompt replying,

I've just tried your advice, but unfortunately it doesn't work.

following testing are all under uninstall status:

Hourglass.exe --sound alarm 5second has no sound Hourglass.exe --use-factory-defaults 5second has beep sound Hourglass.exe 5second has no sound

below testing are under uninstall status with the fix version:

Hourglass.exe --sound alarm 5second has no sound Hourglass.exe --use-factory-defaults 5second has beep sound Hourglass.exe 5second has beep sound

:( not sure if this helps you to address the sound issue of me?

rsyqvthv commented 1 month ago

in Hourglass.config, there has 2 lines relative of sound, I think:

<SoundIdentifier>file:.\alarm.wav</SoundIdentifier>
<LoopSound>true</LoopSound>

don't know why it doesn't sound as result.

i2van commented 1 month ago

@rsyqvthv Have you tried a build?

rsyqvthv commented 1 month ago

yes, if you meant the fix version here: https://github.com/i2van/hourglass/issues/16#issuecomment-2357812456, that's what I mentions in last comment: "below testing are under uninstall status with the fix version:" :)

i2van commented 1 month ago

Have you exited from Hourglass before running fixed version? If not, old one will be proceeding your command.

rsyqvthv commented 1 month ago

yes, I think I do close the previous one, as I click the window close button on upper right when timer is up. and surely it won't messed with other version because I overwrite the previous exe file with the fixed one.

here is my portable pack with the audio files in it, maybe you would like to inspect it:

Hourglass.zip

I use the hourglass.cmd to run it with the preset arguments.

i2van commented 1 month ago

@rsyqvthv Please try latest build. Works for me.

Sound files should be copied to the corresponding folders while not having any Hourglass is being run. Otherwise error Invalid value "<SOUND>" for switch "--sound" will popup.

rsyqvthv commented 1 month ago

Thanks for your update and I use the last build 412:

I closed hourglass and double check the process is not in my task manager. I replaced my hourglass.exe with the last build.

thenI run: hourglass.exe 0:5, it has the beep sound, now I close it, and check in my task manager to make sure it won't left itself there, in case this matters, I also delete the generated hourglass.config and hourglass.exe.config

I put the alarm.wav in the portable folder, so my folder list as this: image I run hourglass.exe --sound alarm 0:5, there isn't any sound when timer expired, only flashing window popup.

:(

i2van commented 1 month ago

@rsyqvthv Could you please try this build?

I added message boxes before playing custom sound and in case of error. Please copy content of message boxes using Ctrl+C and insert them in reply.

rsyqvthv commented 1 month ago

Thanks for give me the debug version, there is one message box shown with the content as below:

---------------------------
Playing custom sound
---------------------------
Sound: C:\desktop\HourglassPortable\alarm.mp3
---------------------------
OK   
---------------------------

which address is correct, here is the folder instrction:

20240921_163851-Explorer EXE

I used comand: hourglass.exe --sound alarm 0:5

i2van commented 1 month ago

@rsyqvthv Was there a sound?

What about .wav instead of .mp3?

i2van commented 1 month ago

@rsyqvthv Could you please check your WMP version? It can be found at C:\Program Files (x86)\Windows Media Player. Reason. Please also check that it plays mp3; if not, corresponding codec should be installed.

image

rsyqvthv commented 1 month ago

What about .wav instead of .mp3?

I've done this before, every time I checked your new build, I also test wav besides the mp3. but they are all no sound playing.

Could you please check your WMP version?

I didn't have wmp installed I think. I've found my program files (x86) and program files, also I search my whole disk using wmplayer, which nothing returning.

I guess maybe this is the issue? I am using LTSC windows 10, maybe they removed the wmplayer for this edition of windows.

any possible hourglass can play mp3/wav sound without install the wmplayer?

i2van commented 1 month ago

@rsyqvthv Could you do the check whether WMP is installed?

any possible hourglass can play mp3/wav sound without install the wmplayer?

Maybe.

i2van commented 1 month ago

@rsyqvthv Please try this build's Portable Hourglass.

rsyqvthv commented 1 month ago

Thank you very much, alarm sound loud and clear using the ba0bd2d (use_naudio) build.

Although it add bit of extra files, but it works, your job is very impressive.

You are my star!

i2van commented 1 month ago

@rsyqvthv I hope I'll release fixed version next week. That one you have it's just for proof of concept and not ready for production.

i2van commented 1 month ago

@rsyqvthv Could you please test this build. You have to copy the files from Hourglass.NAudio.zip next to Hourglass.exe. Without them the default player will be used.

rsyqvthv commented 1 month ago

Thanks for updating

I've download Hourglass.NAudio.zip and HourglassPortable.zip from this build

then I remove all the files in my current hourglass portable folder, refill with the files extracted from the download zips.

added my alarm.mp3 as well

finalized with command: hourglass --sound alarm 0:3 which works prefectly.

:)

i2van commented 1 month ago

NAudio supports the following:

i2van commented 1 month ago

Fixed in 1.15.38