bfroggio / screm

A Windows soundboard controlled via keyboard shortcuts and Twitch chat
MIT License
3 stars 2 forks source link

I think fixing the sample rate issue? #16

Closed xuther closed 3 years ago

xuther commented 3 years ago

@jessemillar

I've added some stuff in to facilitate testing on the sounds (that's next maybe, adding unit tests...), feel free to remove if desired.

You can validate by go test - I've created a little test suite that plays sounds with and without the fix in it. If this actually works and it's not just a thing where my computer acts differently than yours we can delete the flag to enable/disable the fix.

hacktoberfest

xuther commented 3 years ago

Also, you should absolutely pull and validate before merging :) I'm still a little leery that I understood the issue properly. It worked on my gaming machine and on my surfacebook and that's all I have to test it on :D (besides my wife's surfacebook, which is identical to mine.)

To test I created 5 .wav files at different sample rates using audacity (recording my speakers playing the same clip.... sketch, I know) - those are in the test_sounds directory - and then played those back using the code pre fix and post fix.

xuther commented 3 years ago

Also, I added the sailing clip to the success folder. That's just a suggestion since I had it laying around from the tests - I will not be offended in any way, shape, or form if you delete that :)

jessemillar commented 3 years ago

I have gotten the notification for this PR. Not ignoring, just been swamped. <3

jessemillar commented 3 years ago

@xuther Finally got around to looking at/testing this myself. It looks and functions great! If memory serves, I had issues in the past with reinitializing the sample rate after pausing manually but you appear to have solved that (I'm guessing by passing on the doneChan which I know I didn't try). I like having the test that purposefully breaks things for now (the flag you mentioned). Let's leave it and I'll maybe remove it later on as part of an organization effort (I still don't love that everything is in the main.go file and would love to break things into multiple files, but that's for down the road). Thank you so much!