stilesdev / stackmat

Subscribe to events received from a Stackmat timer connected to the browser via the HTML5 Audio API.
https://stilesdev.github.io/stackmat/
MIT License
7 stars 0 forks source link

Stackmat data not parsed correctly? #12

Open PaddyCo opened 2 years ago

PaddyCo commented 2 years ago

I have tested with two timers:

Plugged into the microphone jack on the onboard audio on my desktop PC and none of them seems to get recognized by this library.

It works fine in csTimer on the exact same setup, so it's a bit hard to narrow down why it fails with this library, I did some random console logging and it basically seems to fail to parse the data as it all comes out as random, non-alphanumeric nonsense (basically, majority of the bytes appear to be above 0x80)

I'm guessing that csTimer does some audio processing before parsing the data that makes my setup work?

kletellier commented 1 year ago

Hi, i've solved this problem by changing the signalprocessor by another one find on other github project. You can see this here => https://github.com/kletellier/stackmat

Works fine on my QiYi timer

stilesdev commented 1 year ago

Hey there, sorry for the wait. I agree, it is very difficult to troubleshoot this when it doesn't work on different machines.

Back when I was still using Windows, I remember needing to mess with some of the audio device settings to even get csTimer working. If I remember right, changing the sample rate and/or disabling audio enhancements may have been what got it to work for me. Windows seems to do some extra processing on the signal before passing it to the browser, and I don't really know how to deal with that in this library. csTimer's implementation does seem to be more robust.

On both of my current Linux machines and my Android phone, this library just works out of the box with my Speedstacks G4 timer. I just set up a demo site using this library here, if you want to give that a try.

If it still doesn't work on the demo site, maybe try out kletellier's suggestion and see if that helps, but unfortunately I don't know what to do to improve it at this time.