Created
March 22, 2012 08:45
-
-
Save gausby/2157187 to your computer and use it in GitHub Desktop.
Speak region or a given input
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
(defun say nil | |
"Speak region." | |
(interactive) | |
(let (arg) | |
(if mark-active | |
(setq arg (buffer-substring (region-beginning) (region-end))) | |
(setq arg (read-from-minibuffer "Say: "))) | |
(save-window-excursion | |
(async-shell-command (format "say \"%s\" &" arg))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An async emacs function that speaks the region, or a text input. This uses the system
say
command. Has been testet on OS X.