I've ran some longer tests (played a recording consisting of several hours of silence, opened the output in a wave file editor to see the beeps), and it took over 4 hours for the first beep to arrive... On average I'm getting slightly more than 1 beep per 2 hours (closer to one per 1.5 hours) though.
As it turns out, the rand() function in C++ in Microsoft Visual Studio does not (as in many other compilers) return a value below MAX_INT, but a value below 32768... And I was cutting it at 65536, meaning that indeed the number of beeps would be twice that of what I programmed - once per a bit more than an hour on average.
(In fact, this same bug was also present in my dithering function, I just fixed that too so hopefully the audio quality will also increase a bit).
This still doesn't explain why you were getting so many beeps - are you still getting these? There should be a beep about once per hour in the current version, the next one (just started a new build) should really beep once every 2 hours, on average.
|