KunalBagaria / rustyvibes

A Rust CLI that makes mechanical keyboard sound effects on every key press
https://github.com/kunalbagaria/rustyvibes
MIT License
208 stars 26 forks source link

Split sound into keydown and keyup portions #15

Closed binarybana closed 1 year ago

binarybana commented 2 years ago

I wanted to put a draft PR up since this has bigger changes in functionality, and will require pre-processing of soundpacks in order to support the new format.

What this PR does:

Gaps/deficiencies in this current PR

I'd like to know if this is a direction I should keep pursuing before continuing though. So what do you think?

In trying it out, I think it's pretty flippin' sweet to hear an accurate key down and key up sound at the right times. Really makes it feel realistic. But that's just my $0.02.

KunalBagaria commented 2 years ago

Thank you

Hi, first of all, thank you so much for taking to so much time to contribute to this open-sourced project, I really appreciate it. And yes, you should keep pursuing in this direction, you are single-handedly making rustyvibes so much better.

binarybana commented 2 years ago

Great to hear! I'll keep at it then.

KunalBagaria commented 2 years ago

You can spawn a ffmpeg child process to split the audio files and convert wav into ogg

binarybana commented 2 years ago

Yes, good point to add as another limitation to work around.

Also, a broader question I was thinking about: should the audio conversion utilities be built into the main rustyvibes binary itself? Otherwise, you're going to have to distribute two different binaries, one for pre-processing key packs. I think the downside is that it'll be a slightly larger binary with more dependencies.

On Thu, Oct 7, 2021 at 10:33 PM Kunal Bagaria @.***> wrote:

Also, I saw that up.wav was hardcoded, so the extension would be dynamic for other audio formats like ogg right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kb24x7/rustyvibes/pull/15#issuecomment-938357187, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC75DQE4IYAW7MJW7BDS33UFZ7BNANCNFSM5FSYMXMQ .

KunalBagaria commented 2 years ago

I think it would be better to keep separate binaries since most of the normal users won't notice / care it. Also, I refactored some code into multiple files so you might have some merge issues.