dziemborowicz/hourglass

Does not always ring

Opened this issue · 6 comments

The timer does not always ring

This is evident if you loop the sound: sometimes it starts ringing immediately, sometimes after a few seconds. This delay is important to me

I don't know what are the causes

Can you provide your system specs (including operating system)?

Are you using a custom sound, or one of the included sounds?

I Have Windows 10 Education, 64 bit, version 1703, an i7 6th generation, 8GB of RAM and nVidia GPU

I guess it's the included sound since I don't know how to change the sound?

What sort of speakers? HDMI or USB by any chance?

I've had this sort of issue on my HTPC before where, every time I played some sound, there would be a lag before the sound would actually start playing. The behavior was the same with any media player, etc.

If you download this sound file and play it in a media player (like VLC), do you get similar behavior?

VLC play the wav fine

I have headphones

The behaviour is random anyway.
If you loop the sound, sometimes it starts right away, sometimes the first loops go empty
If you don't loop the sound, sometimes it rings, sometimes it does not ring

This sounds to me like something in the audio stack is taking a while to get initialized, so that sounds doesn't actually starting coming out of the headphones until the sound file is done.

(Hourglass doesn't do anything special here. It just calls the default .NET SoundPlayer.Play method.)

I suspect this is going to be difficult to fix without a repro on my side. One idea might be to play a silent audio file for several seconds before the actual sound is meant to played to help things get initialized.

I don't know how to help you

I found this link which says you should pre-load the sound or use PlaySync

Also this discussion says the Play() is the problem by itself and you should play an emty file before the real file

Then I don't know your code and I don't know how to further help you