Asi emacspeak-binaural
Replace emacspeak auditory icons with binaural beats using the sound theme system. Load when customizing emacspeak sounds, creating new sound themes, or working with binaural audio on macOS with SwiftMac TTS.
install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/emacspeak-binaural" ~/.claude/skills/plurigrid-asi-emacspeak-binaural && rm -rf "$T"
manifest:
skills/emacspeak-binaural/SKILL.mdsource content
Emacspeak Binaural Beat Theme
<<<<<<< HEAD Replace emacspeak's auditory icons with binaural beats via the intended sound theme system.
When to Use
- User wants to change emacspeak sounds to binaural beats
- User asks about customizing emacspeak auditory icons
- User wants to create custom emacspeak sound themes
=======
origin/main
Architecture
Emacspeak has three separate sound systems:
<<<<<<< HEAD
| System | Mechanism | Sound |
|---|---|---|
| Auditory icons | OGG files from theme dir, served via | Chimes on navigation |
| Pure tones | sends to TTS server | Beeps on empty lines |
| Soundscapes | Boodler ambient audio per major mode | Background audio |
On macOS/SwiftMac,
swiftmac-configure-tts forces emacspeak-play-program to nil, routing all icons through SwiftMac's OGG player.
Installation
1. Generate binaural beat OGG files
mkdir -p ~/emacspeak/sounds/binaural cd ~/emacspeak/sounds/binaural SOX=$(which sox) ======= | System | Mechanism | What you hear | |--------|-----------|---------------| | **Auditory icons** | OGG files from theme dir, served to TTS server via `p <filename>` | Chimes on navigation, actions | | **Pure tones** | `dtk-tone` -> `t <pitch> <dur>` to TTS server | Beeps on empty lines, case changes | | **Soundscapes** | Boodler ambient audio mapped to major modes via UNIX socket | Continuous background audio | On macOS with SwiftMac, `swiftmac-configure-tts` forces `emacspeak-play-program` to `nil`, routing ALL auditory icons through SwiftMac's OGG player. ## Creating a Theme 1. Create a directory under `~/emacspeak/sounds/<theme-name>/` 2. Populate with `.ogg` files named after the 56 standard icons 3. Call `(emacspeak-sounds-select-theme (expand-file-name "<theme-name>" emacspeak-sounds-dir))` The cache rebuilds automatically. All playback paths use the same cache. ## Current Installation Theme directory: `~/emacspeak/sounds/binaural/` init.el config (after emacspeak loads): ```elisp (emacspeak-sounds-select-theme (expand-file-name "binaural" emacspeak-sounds-dir))
Generating the Theme
Each icon gets a unique carrier frequency (100-320 Hz) and beat frequency (2-10 Hz):
cd ~/emacspeak/sounds/binaural SOX=/Users/alice/.local/bin/sox >>>>>>> origin/main i=0 for icon in alarm alert-user ask-question ask-short-question button center \ char close-object complete delete-object deselect-object doc ellipses \ fill-object help item key large-movement left mark-object modified-object \ more n-answer network-down network-up new-mail news no-answer off on \ open-object paragraph process-active progress repeat-active repeat-end \ repeat-start right save-object scroll search-hit search-miss section \ select-object shutdown task-done tick-tick time tock-tock unmodified-object \ voice-mail warn-user window-resize y-answer yank-object yes-answer; do carrier=$((100 + i * 4)) beat_tenth=$((20 + (i * 7 % 80))) beat=$(echo "scale=1; $beat_tenth / 10" | bc) freq_r=$(echo "scale=1; $carrier + $beat" | bc) "$SOX" -n "${icon}.ogg" synth 0.15 sine "$carrier" sine "$freq_r" \ gain -18 channels 2 fade q 0.01 0.15 0.02 i=$((i + 1)) done
<<<<<<< HEAD
2. Add to init.el (after emacspeak loads)
(emacspeak-sounds-select-theme (expand-file-name "binaural" emacspeak-sounds-dir))
Pitfalls
- Do NOT override
ordtk-tone
— the sound is auditory icons (OGGs), not tones. Function overrides fail silently becauseemacspeak-icon
/sox-gen-p
may be nil in Emacs's exec-path.sox-play - Do NOT set
— silences more than just tones.SWIFTMAC_TONE_VOLUME=0.0 - Do NOT set
on macOS —emacspeak-play-program
resets it to nil.swiftmac-configure-tts
Icon Dispatch Path (macOS)
emacspeak-icon(icon) -> emacspeak-serve-icon(icon) -> sends "p <filename>\n" to dtk-speaker-process -> SwiftMac doPlaySound -> OGGDecoder -> SoundManager -> audio
Customization
Each icon gets a unique carrier (100-320 Hz) and beat frequency (2-10 Hz). Adjust:
- Duration: Change
(currently 150ms)synth 0.15 - Volume: Change
(lower = quieter)gain -18 - Brainwave band: Vary beat frequencies per icon category
Dependencies
- SoX (
binary for OGG generation)sox - Emacspeak with SwiftMac (macOS)
Related
— Raman's built-in binaural module (sox-gen.el
)M-x sox-binaural
— Ambient audio per mode (soundscape.el
)M-x soundscape-toggle- Sound themes:
(default),chimes/
— switch with3d/
=======M-x emacspeak-sounds-select-theme
56 Standard Icon Names
alarm alert-user ask-question ask-short-question button center char close-object complete delete-object deselect-object doc ellipses fill-object help item key large-movement left mark-object modified-object more n-answer network-down network-up new-mail news no-answer off on open-object paragraph process-active progress repeat-active repeat-end repeat-start right save-object scroll search-hit search-miss section select-object shutdown task-done tick-tick time tock-tock unmodified-object voice-mail warn-user window-resize y-answer yank-object yes-answer
Missing icons fall back to
button.ogg (via emacspeak-sounds-cache-get default).
Pitfalls on macOS
DO NOT override dtk-tone
or emacspeak-icon
dtk-toneemacspeak-icon
/sox-gen-p
are nil ifsox-play
is not in/Users/alice/.local/bin/
atexec-path
load timeemacspeak-preamble.el- The sound you hear is auditory icons (OGGs), NOT tones -- overriding
changes nothing audibledtk-tone
DO NOT set SWIFTMAC_TONE_VOLUME=0.0
SWIFTMAC_TONE_VOLUME=0.0This env var silences more than just pure tones. Remove it.
DO NOT set emacspeak-play-program
manually on macOS
emacspeak-play-programswiftmac-configure-tts sets it to nil during startup. Fighting this breaks icon playback.
Icon playback dispatch
emacspeak-icon(icon) -> emacspeak-play-program is nil? (macOS: always yes) -> emacspeak-serve-icon(icon) -> sends "p <filename>\n" to dtk-speaker-process (SwiftMac) -> SwiftMac plays the OGG file via AVAudioEngine
Brainwave Bands per Icon Category
Action icons (delete, yank, fill) -> beta beats 13-40 Hz (alertness) Navigation icons (left, right, scroll) -> alpha beats 8-12 Hz (relaxed focus) Status icons (complete, task-done) -> theta beats 4-8 Hz (satisfaction) Warning icons (alarm, warn-user) -> gamma beats 40+ Hz (attention)
Dependencies
- SoX (
andsox
atplay
)/Users/alice/.local/bin/ - Emacspeak with SwiftMac TTS server
- macOS (SwiftMac is macOS-only via AVSpeechSynthesizer)
origin/main