Repository navigation
Add bot speak sound words for piezo buzzers - #3676
Open
ktobias-dev wants to merge 2 commits into
Open
ktobias-dev wants to merge 2 commits into
ktobias-dev wants to merge 2 commits into
Conversation
Received messages containing sound words (happy, sad, question, excited, alarm, chatter, ack, razz, surprised, hello, goodbye, uh-oh, low battery) play short robot-style chirps, sweeps and warbles on the buzzer instead of the normal notify tune. Up to 4 words per message play in order. - botspeak_sounds.h: sounds as compact 4-byte segments (start/end freq, duration, vibrato) plus the word table - genericBuzzer: non-blocking sweep player driving tone() every 2 ms - ui-tiny: hooks for contact and channel messages (sender name is skipped), and a "bot speak" home page to toggle playing sound words while a phone is connected (saved as comp.bot_ph, off by default) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"yes"/"y" plays a single bright bell ding, "no"/"n" a low double buzz. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Please no. this would be super annoying. the ability to remotely trigger someone's devices to make sound is going to be abused for sure. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3675
Summary
Received messages that contain certain words play short robot-style chirps, sweeps and warbles on the piezo buzzer, instead of the normal notify tune. Nothing changes on the wire: the receiver recognizes words in the plain text and synthesizes the sound locally.
Changes
src/helpers/ui/botspeak_sounds.h(new): each sound is a table of 4-byte segments: start/end frequency, duration (4 ms units) and vibrato rate/depth, written with aBOT_SEG(f0_hz, f1_hz, ms, vib_hz, vib_depth_hz)macro. Also holds the word table. Onlybuzzer.cppincludes it.genericBuzzer: a non-blocking sweep player,playBot(segs, count). It glides exponentially from f0 to f1 and updatestone()every 2 ms fromloop().playWords(text)queues up to 4 matched sounds with a 150 ms gap between them. Starting an RTTTL tune stops a bot sound and vice versa, andquiet(true)stops playback. Existing RTTTL behavior is unchanged.ui-tiny:onMessageRecv/onChannelMessageRecvcallbuzzer.playWords()afternotify(), so vibration still fires and a matched word replaces the tune. For channel messages the<sender>:prefix is skipped first.NodePrefs::bot_with_phone, saved ascomp.bot_phand off by default. When off, sound words follow the existing "only when no phone is connected" rule. A new "bot speak" home page toggles it; turning it on plays "happy" as confirmation.Notes
:emoji:-style tokens, but it's easy to change if you prefer.ui-tinyis wired up so far.ui-newandui-origboards build with the new buzzer code but don't callplayWords()yet. I can add that here or in a follow-up.Testing
LilyGo_T-Echo_Card_companion_radio_blebuilds on this branch (RAM 62.6%, Flash 49.8%).heltec_v4_r8_companion_radio_ble(ESP32, has a buzzer) built successfully with the player code before the final rename and rebase ontodev. It hasn't been rebuilt since.main-based build): every sound plays correctly when a direct or channel message is received, and the "bot speak" page and phone setting work as expected.🤖 Generated with Claude Code