![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Contents
An Alfred 3 workflow that uses macOS's TTS (text-to-speech) feature to speak text aloud,
especially for multi-lingual use (macOS allows on-demand download of voices in other languages).
Note: Use of workflows in Alfred 3 requires the paid Power Pack add-on - an investment well worth making.
The workflow comes with two distinct feature groups:
Speak the active application's text with a specific voice.
Speak specified text with one or more voices, selectable by name(s) or language(s).
Note that both feature groups target active voices; i.e., the set of voices
selected for active use in System Preferences
.
If you know that a voice is installed, yet it doesn't show up in the workflows,
make sure it has a check mark in System Preferences > Dictation & Speech > Text to Speech > Systme Voice > Customize...
.
This is also where you download additional voices.
You can get there more quickly from either the speak
or say
keywords with no arguments by pressing ⌥↩
(Option+Return).
Caveat: Currently, only voices provided by Apple are supported, not third-party voices such as InfoVox iVox.
See also: CLI voices, which this workflow uses behind the scenes.
This feature group comprises:
speak
with an ad-hoc selectable voice; e.g.:
speakalex
or speak alex
or speak @alex
speak with voice "Alex".This feature is based on the system feature for speaking the active application's text, wrapping it with the ability to speak with a specific voice on demand.
This implies the following, whether you invoke the feature with keyword speak
for ad-hoc voice selection or via a dedicated keyboard shortcut:
It acts as a toggle: invoking the keyword or a shortcut again while speech is still in progress stops it.
You can, but do not need to select the text to speak - depending on the application,
all text may be spoken implicitly (e.g., in TextEdit.app
), or, in Safari.app
,
Reader view (if available) is automatically activated to read only the text
of interest.
Conversely, however, non-native macOS applications may not report even explicitly
selected text to the system; in that case, use the global keyboard shortcut
associated with the say
keyword (see next chapter).
Note:
A side effect of speaking with a given voice is that that voice implicitly
becomes the new default voice.
This means that, from that point on, invoking speech without specifying a voice
will use that voice.
Keystrokes are sent behind the scenes to activate the system
feature for speaking the active application's text with the default voice.
For the most part, this works fine, but occasionally, especially under heavy system load, this may fail.
(If you know of a way to invoke this system feature programmatically, do let me know.)
Option+Esc
by default) to trigger speaking.This feature group comprises:
say
, which speaks given text as part of the Alfred 3 command line, with one or more voices selectable by name(s) or language(s).say
with the explicitly selected text in the active application.speak
keyword wouldn't recognize.say
redisplays itself after speaking so as to facilitate iterative experimentation.
say[<voice>]
or say @<voice,...>
selects one or more voices by name; e.g.
sayalex Speak this.
speaks "Speak this." with voice "Alex".say @alex Speak this.
does the same.say @al,ji Speak this.
speaks with voice "Alex", then "Jill" - note how using name prefixes is enough.say #<lang,...>
selects one or more languages by their IDs; e.g.:
say #enus,enin Speak this.
speaks with all US-English (en_US
) and Indian English
voices (en_IN
) - note how case and punctuation do not matter.@
or #
specifier may be placed either before or after the text to speak.Additionally, using modifier keys alongside ↩
(Return) offers additional functionality:
⌥↩
(Option+Return)
System Preferences
to the relevant
pane to manage voices and TTS features.⌃↩
(Control+Return)
⇧↩
(Shift+Return)
say
keyword, you can use the workflow on older macOS versions too, provided you install it manually.System Preferences
.Dication & Speech
, anchor Text to Speech
, ensure that Speak selected text when the key is pressed
is checked.⌥⎋
(Option+Esc), in place (recommended).
Note: Even if you don't use Node.js itself: its package manager, npm
, works across platforms and is easy to install; try
curl -L http://git.io/n-install | bash
With Node.js installed, install the package as follows:
[sudo] npm install speak.awf -g
Note:
sudo
depends on how you installed Node.js and whether you've changed permissions later; if you get an EACCES
error, try again with sudo
.Caveat: If you reinstall or upgrade this workflow, your custom keyboard shortcuts and customized keywords are retained, but the following aspects of customization must be performed again:
Customization has two to three parts:
Speak selected text when the key is pressed
system feature (not recommended): see the next chapter.Unless already there right after having installed the workflow, open Alfred 3's Preferences...
dialog
via Alfred 3's menu-bar icon and locate workflow Speak Active App's Text
.
The workflow comes with three predefined hotkey-based definitions, based on preinstalled voices "Alex", "Vicki", and "Victoria" Adapt them to your needs:
Hotkey
box:
Hotkey
field and pressing the desired key combination.
⌥1
(Option+1), ⌥2
, ... for the voices of interest.Text
input field , using a voice name as displayed in System Preferences > Dication & Speech > Text to Speech
To define additional hotkey-triggered voices:
Hotkey
box and select Copy
.Paste
- a new, empty Hotkey
box will appear.Run Script
box.Hotkey
box, drag a connection to the new Run Script
box.Hotkey
box as described above.Speak - TTS (Text-To-Speech) Workflows
), control-click on it in the list on the left, and select Show in Finder
.toggleSpeaking
in a text editor and follow the instructions at the top of the file.To assign a hotkey (global keyboard shortcut) to the feature that invokes say
with the text currenctly selected in the active application:
Hotkey
box below the say
keyword box.⌥`
(Option+`)Copyright (c) 2015-2017 Michael Klement mklement0@gmail.com (http://same2u.net), released under the MIT license.
This project gratefully depends on the following open-source components, according to the terms of their respective licenses.
npm dependencies below have optional suffixes denoting the type of dependency; the absence of a suffix denotes a required run-time dependency: (D)
denotes a development-time-only dependency, (O)
an optional dependency, and (P)
a peer dependency.
Versioning complies with semantic versioning (semver).
v0.4.2 (2017-01-03):
v0.4.1 (2016-10-02):
v0.3.5 (2015-11-08):
README.md
link to current installer fixed.v0.3.4 (2015-11-07):
README.md
corrections and improvements.v0.3.3 (2015-11-03):
README.md
corrections and improvements.v0.3.2 (2015-11-03):
v0.3.1 (2015-11-03):
say
-invoking hotkey now appends a space to the pasted text
so as to allow typing @
right away to select a voice or voices of interest.say
now correctly reflects the current default voice even after changing it implicitly via hotkey.$HOME/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/net.same2u.speak.awf"
- the old folder
can safely be removed: $HOME/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/net.same2u.say.awf"
README.md
corrections and improvements.v0.3.0 (2015-11-02):
say
for interactive experimentation with
multiple voices, selectable by name(s) or language(s). Consistent use of modifiers
keys across keywords speak
and say
: ⌥↩
to make a specific voice the new default /
invoke System Preferences
to manage voices, ⌃↩
to stop ongoing speech, ⇧↩
to clear
the current argument list.v0.1.6 (2015-11-01):
README.md
corrections.v0.1.5 (2015-10-30):
README.md
update: npm
badge and install instructions added.v0.1.4 (2015-10-30):
v0.1.3 (2015-10-30):
v0.1.2 (2015-10-30):
v0.1.1 (2015-10-30):
README.md
improvements.v0.1.0 (2015-10-30):
FAQs
Alfred 3 workflow for using macOS's text-to-speech features
We found that speak.awf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.