blankriot96 / pyhb Goto Github PK
View Code? Open in Web Editor NEWAn ASMR keyboard sound effect CLI package
License: GNU General Public License v3.0
An ASMR keyboard sound effect CLI package
License: GNU General Public License v3.0
This includes:
CONTRIBUTING.md
The spacing between characters in the typing tester is uneven.
This causes a whole hoard of problems :
Some possible solutions :
pygame_gui
)keyboard_sound_effects.py is rather cluttered and not well designed. It uses globals in a bad way and has its own main
method making it seem like an independent script (albeit, it could be).
Refactoring the current TextManager class would be a good idea. Currently this class is used as a convenience utility to group together initialization data and runtime data, but this is against what a class is for.
A class should represent some data,/ represent some kind of object.
Moving to functional approach might be better. Extraction of result calculation is also a priority.
The current README file assumes pyhb
can still be installed from pypi.org
Some changes to be made:
Create documentation for branching strategy - BRANCHING.md
Punctuation for some reason refuses to work, capitalization, any punctuation at all, breaks the application.
Relevant file -> https://github.com/blankRiot96/pyhb/blob/main/pyhb/typing_tester/text_manager.py#L101
The play
function within pyhb/cli/commands.py
is pretty poorly written. Can be refactored.
So when you finish a type test and this is your state:
The problem is that it takes 2 successive clicks on the retry button before you can actually take another typing test
Also, the settings you choose on this state does not carry on to the typing test, ie, it uses the old settings with which you launched the typing test.
Relevant file -> https://github.com/blankRiot96/pyhb/blob/main/pyhb/typing_tester/settings.py#L115
Currently pyhb
only has a main
branch which represents the most active stage of the project.
But this has a couple issues, and I believe keeping the changes committed to separate branches, and then merged into main
for releases works much better.
Possible branching strategy:
main
branch for releases, dev
branch for commits.main
branch for releases, (typetester
, cli
) branches for development.releases
branch for releases, main
branch for development.When you try pyhb start
and then choose a sound pack, it doesn't actually play the sound effect until you release the key you are pressing. Now this by itself sounds fabulous and least problematic when typing constantly, but it just feels weird that the sound effect comes only after the key is released instead of immediately playing the sound when the key is pressed like an actual mechanical keyboard would make.
I have tried some things out in the keyboard_sound_effects.py but have failed to come out with any fast and memory efficient results. For example in this line, when changing it to
keyboard.on_pressed(set_release)
This works and now plays the sound immediately when clicking on a key.
But now the problem is that it starts the spam a very annoying sequence of the same sound when holding on to it.
I have made multiple attempts to fix this, such as removing everything related to the global RELEASED
varaible, and instead just playing the sound. But this does the same as keyboard.on_pressed
and for some reason is even slower
Another attempt was
global RELEASED
while True:
keyboard.on_release(set_release)
if RELEASED:
key_pressed = keyboard.read_key()
if key_pressed in conf_vals:
if sound_pack == "nk-cream":
sound = pygame.mixer.Sound(
f"{user_path}/Soundpacks/{sound_pack}/{key_pressed}.wav"
)
else:
...
But now this is incredibly slow and causes an eventual MemoryError
every time.
pyhb
is essentially an application on its own, it doesn't extend or help Python in any way. There seems to be little to no reason for this to exist on pypi.
Some things to think about:
Currently, the unittests don't really help. It tests minor things and fails due to improper checking
Using click
, refactoring the CLI into its own package seems right.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.