feat(plugins): add Slowed playback plugin#4400
feat(plugins): add Slowed playback plugin#4400The-Kryz wants to merge 8 commits intopear-devs:masterfrom
Conversation
Maybe we should introduce a unified way for all plugins to use the audio context, w/o having conflicts. |
|
PS: If you need help with the solidjs stuff, I can help. |
|
Done! I've fully refactored the plugin to follow the SolidJS standards: Replaced manual DOM injection with Solid's render and JSX. Implemented createSignal and createEffect for reactive state management. Switched to the native stylesheets option for CSS. Added a proper stop() method and onCleanup to ensure all intervals and UI elements are destroyed when the plugin is disabled. Thanks for the guidance, @ArjixWasTaken! Let me know if there's anything else to adjust. |
|
And I fixed some bugs BTW xD |
ArjixWasTaken
left a comment
There was a problem hiding this comment.
Some more stuff I could point out using my phone
|
Sorry about the changes to package.json! I was encountering a TypeError: Cannot read properties of undefined (reading 'date') error in my local Windows environment when trying to compile the application, and adding ajv-formats was a workaround I tried to fix the problem. I am now reverting package.json and pnpm-lock.yaml to their original states, as I realized it was a problem in my local environment that shouldn't affect the main repository. Thank you for noticing this! |
|
All set! I've replaced the conditional rendering with the component to ensure reactivity works as intended in SolidJS. I also double-checked the cleanup logic and it's working smoothly now. Everything should be in line with the project's standards now. Thanks, @ArjixWasTaken! |
ArjixWasTaken
left a comment
There was a problem hiding this comment.
Other than this, everything looks good to me.
|
All done!! thks again @ArjixWasTaken! |
|
Great, I'll check this out on my computer once I have the time, to see if there are any bugs left. |
|
Just a note: this is an electron app, aka chromium, we can't use Firefox/safari specific stuff. |
|
Fixed! |
Is it really problem in your local environment? I get same error when building. And even Actions in this repo get it xd |
|
Honestly, I'm relieved to see that the compilation error is also happening in the Actions. I spent a lot of time thinking the problem was my Windows environment! 😂 Apparently it seems to be a problem across the entire repository; I reverted all my workarounds in package.json to keep this PR clean. I've officially given up on fixing the build environment for now and am now fully committed to While the plugin isn't in the main, I'm using it like this to listen to my music xD |
|
Plugin works fine and I don't see any obvious bugs. @The-Kryz would it be ok to you if I rework the UI? PS: The reason I am not a fan of it, is because it is too present, if other plugins also did that, it'd make a mess of the screen real estate. It'd be better if it was integrated with the player controls. |
|
Hey @ArjixWasTaken! Sure, you can go ahead and rework the UI, no problem at all. I totally understand your point about the screen real estate, and integrating it into the player controls makes a lot of sense. Glad the core logic is working fine! Feel free to make any necessary changes. |
Description:
This PR introduces a lightweight "Slowed" plugin that adds a floating UI to control playback rate and pitch preservation, allowing users to easily simulate Slowed or Nightcore effects directly in the app.
Technical Decisions:
I intentionally avoided using the Web Audio API (
AudioContext,BiquadFilterNode) for Reverb or Bass effects. Since the browser only allows the audio stream to be captured bycreateMediaElementSourceonce, doing so would causeInvalidStateErrorconflicts with existing plugins like the native Equalizer or Crossfade.By relying solely on
HTMLMediaElement.playbackRateandpreservesPitch, this plugin is 100% compatible with the rest of the ecosystem and won't break other audio plugins.