Live data from Hacker News

Reverse-engineering my speakers' API to get reasonable volume control

jamesbvaughan.com

41–50 of 144 posts

Re: Reverse-engineering my speakers' API to get reasonable volume control

#41
post #37

What the hell browser makers... Make it so that file:// URLS are extremely locked down and doesn't have enough rights to even fetch files in the same directory (or even itself), yet grant localhost URLs full permissions... There's a reason why local web applications aren't a collection of HTML and JS files, and are instead full copies of the Chromium browser.

What are you talking about? The OP made requests from his Bun server. CORS would obviously break any request made directly from js in the browser

Re: Reverse-engineering my speakers' API to get reasonable volume control

#42
post #37

What the hell browser makers... Make it so that file:// URLS are extremely locked down and doesn't have enough rights to even fetch files in the same directory (or even itself), yet grant localhost URLs full permissions... There's a reason why local web applications aren't a collection of HTML and JS files, and are instead full copies of the Chromium browser.

The difference is that file:// URLs can be opened by your grandparent opening a .html file that they downloaded, whereas http://localhost requires you to actually set up a web server.

Imagine double-clicking a malicious page.html and suddenly your entire Documents folder can be fetched and manipulated by JavaScript. Yikes.

But to your latter point, yeah, there’s no reason sandboxed web apps couldn’t be given better file:// permissions.

Re: Reverse-engineering my speakers' API to get reasonable volume control

#44
Seems like the author moved from a “speakers + networked amp” setup, to a one where with active speakers where everything is built-in.

When I was buying speakers for my apartment some time ago, I was similarly considering going for the all-in-one options like this, but I’m glad I didn’t. I prefer the “dumb passive speaker + networked amp”, as it allows you to pick / replace / upgrade the separate components. Went for the KEF LS50, and for the amp Lyngdorf TDAI-1120. And that’s despite KEF having the all-in-one active version of those speakers. Very happy with my choices!

Re: Reverse-engineering my speakers' API to get reasonable volume control

#45
Wow, I never thought speakers would connect to the network, let alone be running Linux and a webserver for a hidden interface. Honestly, I thought speakers still weren't any more complicated than "convert this digital signal into a signal playable by the driver" with a volume knob.

Re: Reverse-engineering my speakers' API to get reasonable volume control

#46

Hey OP - if your thinking about a smart knob with haptic feedback etc - check this open source project out that you can build yourself - its amazing: https://github.com/scottbez1/smartknob Video demo here: https://www.youtube.com/watch?v=ip641WmY4pA&t=1s

Oh man, this has been on my to-build list for ages, right up there with the 6 axis “3D mouse” build. I love the attention to detail.

Re: Reverse-engineering my speakers' API to get reasonable volume control

#47

Wow, I never thought speakers would connect to the network, let alone be running Linux and a webserver for a hidden interface. Honestly, I thought speakers still weren't any more complicated than "convert this digital signal into a signal playable by the driver" with a volume knob.

The digital to analog conversion is even complicated for a speaker. They just take the analog signal. It's really just an electromagnet that moves a cone that vibrates and pushes air around.

Re: Reverse-engineering my speakers' API to get reasonable volume control

#48

I wish someone would solve the opposite problem in PCs and laptops—that of too little audio gain. Designers never leave any gain in reserve for when audio input levels are too low. Why do they do this? The problem is so obvious that you'd reckon they're doing it to deliberately annoy users. The problem doesn't stop there, the lack of gain with Bluetooth is notorious. Almost every Bluetooth device I own has insufficie…

> Why do they do this?

So they don't damage users' speakers, their hearing, or generally cause annoyance.

> They just assume a 16-bit input has 65536 levels and that's the range. Full stop! They never give consideration to what happens when the peak audio input covers perhaps less than one third that range of bits.

1/3 of 65536 is still +-11,000 voltage levels, or 14.4 bits of information. That's a really good place for a signal to be! It leaves a bit (literally) of room for the peaks without clipping.

Now if you meant 1/3 of 16 bits = 5.3 bits of information, that is indeed a poorly recorded signal. +-20 voltage levels. It's going to sound terrible whether you boost it digitally or analogly. (is that a word?)

Re: Reverse-engineering my speakers' API to get reasonable volume control

#49

Hey OP - if your thinking about a smart knob with haptic feedback etc - check this open source project out that you can build yourself - its amazing: https://github.com/scottbez1/smartknob Video demo here: https://www.youtube.com/watch?v=ip641WmY4pA&t=1s

Wow!

I had dreamed of physical "analog" controls as a standard feature on keyboards and input devices for various applications -- would be great productivity booster for power users.

I wish this catches on and gets mass adoption.

Post reply on HN