Add custom sound effect menu items.
I'm imagining a submenu for Sound, offering different choices for finger up / down, and toggling one or both off independently. The "Add Sound..." item could just open a Finder window to ~/Library/Application Support/HapticKey/Sounds/ and allow the user to drop custom sound files in that folder.
Is this something you'd consider merging? Interested in your feedback.
I think the first level of selection for the sound effect would be better to only have “None”, “Default”, and “Custom.” Since most of users may not use custom sound effect, it would be better to make it simple for that use case. Then, for the custom case, it may give users to select a some flexibility of customization as you suggested.
Okay great! I'll look into making a patch sometime soon.
Would you be okay with me splitting the current default sound into separate touch down / touch up sounds by default? Right now the current behavior is to play a sound that includes both down/up sounds on the down action.
Sure, however, current default sound is the one can be found in macOS shared resource, which is a single sound file contains both down and up effects. Since it was’t easy to find a better sound effect resources that don’t cause any license issues, this is the solution for now.
Ideally it would be better to have a separation for each event, but it might need some extra work.
I guess to avoid license issues for shipping a modified version of that file I could figure out a nice timestamp for splitting that specific file and do it once at launch.
What other technical issues do you see playing separate sounds for the up/down events? Although I havent looked too deeply I figured it would be a relatively simple patch to add a sound for the up event.
No, other than having such tricks, like separating the sound by the time to avoid license issues, it should be simple and straightforward as you found! 😊
Got the sound file splitting to work! Still have a bunch of other stuff to do, but it already sounds/feels great. Progress so far: https://github.com/niw/HapticKey/compare/master...chrisballinger:sound-submenu
Nice!
It might be better to use in-memory partial sounds generated from CoreAudio.component/Contents/SharedSupport/SystemSounds files instead of writing them out to the file? Also I suggest to have a simple file check, may be SHA1 hash, so that at least the application doesn't make nay unexpected sounds from these files.
And... it's very common comment in open source world though, it would be really appreciate if you can use same coding format as the one used on master.
It might be better to use in-memory partial sounds generated from CoreAudio.component/Contents/SharedSupport/SystemSounds files instead of writing them out to the file?
The reason I'm writing them out to separate files is that directory is where I was intending all sound files will be stored (including custom ones). The conversion process is only meant to happen once on first launch (or if the default sounds were deleted for whatever reason). Another benefit is that if you want to later drop custom sounds in that folder, they can be enumerated and selected with the same menu logic as the default sounds. Hopefully this will be clearer once I get closer to finishing up, things are still sort of hacked together at the moment.
Also I suggest to have a simple file check, may be SHA1 hash, so that at least the application doesn't make nay unexpected sounds from these files.
Good call, hopefully there isn't much variation between macOS versions. It seems like those sound files are pretty ancient.
And... it's very common comment in open source world though, it would be really appreciate if you can use same coding format as the one used on master.
No problem. Do you just mean tabs vs spaces, or do you have a preferred style guide?
Thank you for the pull request, I’ll review it soon!
Sorry for late reply, since now we have #10, I’m going to reply for your comments on #10. That might be better to continue this thread here.