r3oath / burst-type.pro

Practice typing the most common words to build burst speed and muscle memory.
https://www.burst-type.pro/
GNU General Public License v3.0
24 stars 9 forks source link

Enhancement: Sound effects #39

Closed Glodigit closed 1 year ago

Glodigit commented 1 year ago
  1. Tapping a character
  2. Typo
  3. Slow - Low and long (~0.75s) note
  4. Success - Higher pitch and shorter length note on every consecutive run. Ideally, there'd even be a sound effect like what's featured in powerline.io when your snake is near another snake.
  5. Streak complete
christianholman commented 1 year ago

You picking this up? Would be fun to implement.

r3oath commented 1 year ago

You picking this up? Would be fun to implement.

I'm cool if you want to take a crack at implementing it. The state object has all the information you need to determine most of the sound related events as it's updated.

It may be possible to simply use a custom hook (useEffect) that acts on state changes and dispatches a sound effect. I'd suggest using a library that can generate tones via code as opposed to having to store or play audio files.

There'll probably need to be an audio toggle button added to the menu as well, perhaps next to the theme toggle button.

Happy to hear any other ideas.

Glodigit commented 1 year ago

You picking this up? Would be fun to implement.

Unfortunately, no, so I thought of at least drafting an "If I could implement this, what would I need to do?" list.

christianholman commented 1 year ago

Yeah I'll for sure take a stab at it, was hacking around with a dynamic theming thing yesterday that could also be cool. Love this type of app.

christianholman commented 1 year ago

You picking this up? Would be fun to implement.

I'm cool if you want to take a crack at implementing it. The state object has all the information you need to determine most of the sound related events as it's updated.

It may be possible to simply use a custom hook (useEffect) that acts on state changes and dispatches a sound effect. I'd suggest using a library that can generate tones via code as opposed to having to store or play audio files.

There'll probably need to be an audio toggle button added to the menu as well, perhaps next to the theme toggle button.

Happy to hear any other ideas.

As for other ideas, I would prefer playing an audio file. Maybe warped to be slightly different per key, and the sound itself being selectable by the user in some preferences. I for example love using the Osu pop sound in monkeytype.

r3oath commented 1 year ago

If we were to use prerendered sounds, it'd probably make sense then to have a modal/dialogue configuration window (like the wpm, streak, and wordlist settings) where the user can select between different typing, error (slow & typo), success, and streak complete sounds, as well as a general volume option (off, low, medium, high).

r3oath commented 1 year ago

Yeah I'll for sure take a stab at it, was hacking around with a dynamic theming thing yesterday that could also be cool. Love this type of app.

Feel free to create a new feature request for dynamic theming if you want to talk about it further so we don't muddy up the conversation here 👍

christianholman commented 1 year ago

If we were to use prerendered sounds, it'd probably make sense then to have a modal/dialogue configuration window (like the wpm, streak, and wordlist settings) where the user can select between different typing, error (slow & typo), success, and streak complete sounds, as well as a general volume option (off, low, medium, high).

Good idea, a modal menu system would be awesome for more things, like the dynamic theming as well! I wrote an initial little engine at #41 - let me know what you think