vicwomg / pikaraoke

Youtube-based Karaoke machine for Raspberry Pi, OSX, Windows, and Linux
GNU General Public License v3.0
461 stars 117 forks source link

Suggestion: use websocket instead of polling the status every 1.5 seconds #320

Open xuancong84 opened 4 months ago

xuancong84 commented 4 months ago

Hi @vicwomg , just wondering if you are still working on this project, it might be a good idea to use WebSocket (which I was learning recently) to inform each client when the play status has changed. Making an HTTP request every 1.5 seconds per client can be too costly when there are more users.

vicwomg commented 4 months ago

That's a great idea and I tried to implement websocket in v1.2 but ultimately went forward with polling because I was more familiar with it.

I am still working on the project when I have time, which is very limited. I welcome contributors.

frankchau93 commented 3 months ago

Hi @vicwomg , just wondering if you are still working on this project, it might be a good idea to use WebSocket (which I was learning recently) to inform each client when the play status has changed. Making an HTTP request every 1.5 seconds per client can be too costly when there are more users.

Would definitely like to look into websockets. Hope it's possible.

xuancong84 commented 3 months ago

Would definitely like to look into websockets. Hope it's possible.

Actually, I have already implemented WebSocket in my fork, you may want to do a pull and merge, but it will be tough as there are too many changes. I am currently interested and doing adding songs by speaking the song title, using OpenAI's Whisper model to do speech-to-text.