r/howdidtheycodeit • u/AdventurousText9311 • Apr 21 '26
How would one code a bluetooth audio override message?
Forgive me if this is the wrong sub. I'm training my dog on communication buttons and realized that he can't tell me he wants to go out if I am in my office on a call. I was thinking it would be great if I could automate some sort of bluetooth message to come through my headset to let me know, as I am not always looking at the computer or phone screen at a popup while I'm deep in writing. Or any kind of useful idea in that direction :D
0
Upvotes
4
u/dirtywastegash Apr 21 '26
I would hook a button or something the dog can press to an ESP32, or similar IoT chip, running code which connects it to WiFi, has you pc/laptop IP and sends a packet to your app running on the pc / laptop that plays a sound when it gets the packet.
Button press -> Esp -> ping sent -> laptop receives -> sound plays.
Smart dog could probably have a few buttons for different requests
-1
u/LaughingIshikawa Apr 21 '26
This is less about "code" per se, and more about having access to the internals of different systems.
What you're describing is something like "when this event fires, mute / diminish all other sounds and play X audio file" which is "easy" to do... If you can get access to the audio that's being streamed to the headphones somewhere along that pipeline. The problem is everywhere along that pipeline (audio drivers, operating system, whatever program you're playing music / podcasts / VOIP call audio from...) doesn't want to allow you to insert and run random code into it's program (kinda the definition of a security vulnerability 😅😅) so the only other option is to create one more program that sits somewhere in that pipeline... Just to "listen" for button presses, and play the associated audio clips.
If you do that then you have to manage the interface(s) between that program and the buttons, plus whatever it's receiving the audio stream from / giving the audio stream to - that's not technically unsolvable by any means, but it's generally more work than anyone wants to take on for a small benefit.
I'm trying to think of a good analogy, and it's sorta like... you're concerned about people throwing away stuff that could be recycled, so you ask all your neighbors to give you their trash to sort through so you can take out all the recyclables before it goes to a landfill. It's technically feasible and not even all that "complicated" It's just too fiddly and time consuming for most people to bother with beyond maybe a weekend project to prove to themselves that they can. 😅🙃
-2
u/sadafxd Apr 21 '26
Smart watch notification