Using spd-say in a bash script function The Next CEO of Stack OverflowRedirecting output when I execute “bash -c …” from a C programfor loop in bash functionWhat's the best way to make a bash function in a script as a parameter when running via command line?Execute only if it is a bash functionFunction for archiving arbitrary files with encryptionHow to make a function available to the command `parallel` (GNU)?How to catch and handle nonzero exit status within a Bash function?Bash function assign value to passed parameterPassing multiple arguments to sudo within functionHow to calculate say output duration?
Sending manuscript to multiple publishers
How powerful is the invisibility granted by the Gloom Stalker ranger's Umbral Sight feature?
How to invert MapIndexed on a ragged structure? How to construct a tree from rules?
Do I need to enable Dev Hub in my PROD Org?
If the heap is initialized for security, then why is the stack uninitialized?
Return the Closest Prime Number
Are there any limitations on attacking while grappling?
Non-deterministic sum of floats
Is "for causing autism in X" grammatical?
Won the lottery - how do I keep the money?
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
If a black hole is created from light, can this black hole then move at speed of light?
How to count occurrences of text in a file?
Is micro rebar a better way to reinforce concrete than rebar?
How to solve a differential equation with a term to a power?
Why am I allowed to create multiple unique pointers from a single object?
Would a galaxy be visible from outside, but nearby?
Inappropriate reference requests from Journal reviewers
Should I tutor a student who I know has cheated on their homework?
Elegant way to replace substring in a regex with optional groups in Python?
I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin
How do I reset passwords on multiple websites easily?
Preparing Indesign booklet with .psd graphics for print
MessageLevel in QGIS3
Using spd-say in a bash script function
The Next CEO of Stack OverflowRedirecting output when I execute “bash -c …” from a C programfor loop in bash functionWhat's the best way to make a bash function in a script as a parameter when running via command line?Execute only if it is a bash functionFunction for archiving arbitrary files with encryptionHow to make a function available to the command `parallel` (GNU)?How to catch and handle nonzero exit status within a Bash function?Bash function assign value to passed parameterPassing multiple arguments to sudo within functionHow to calculate say output duration?
I'm sure this is fairly elementary, but I can't figure it out.
My script:
#!/bin/bash
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
What I'm trying to make happen is use spd-say in a function to make the computer talk to me.
The echo portion of my function works. It outputs both lines of text that I feed to it in the expected order. However, the spd-say part doesn't. It only ever says the last line. I'm assuming it's because the second command is "overwriting" the output of the first because it's trying to run them in parallel to the same output. I've tried adding ;wait, &&, and various other things to the end of the sez command, on the next line after, within the function on the spd-say command, etc, but everything I'm trying isn't helping.
What am I doing wrong?
bash shell-script audio function text-to-speech
add a comment |
I'm sure this is fairly elementary, but I can't figure it out.
My script:
#!/bin/bash
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
What I'm trying to make happen is use spd-say in a function to make the computer talk to me.
The echo portion of my function works. It outputs both lines of text that I feed to it in the expected order. However, the spd-say part doesn't. It only ever says the last line. I'm assuming it's because the second command is "overwriting" the output of the first because it's trying to run them in parallel to the same output. I've tried adding ;wait, &&, and various other things to the end of the sez command, on the next line after, within the function on the spd-say command, etc, but everything I'm trying isn't helping.
What am I doing wrong?
bash shell-script audio function text-to-speech
add a comment |
I'm sure this is fairly elementary, but I can't figure it out.
My script:
#!/bin/bash
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
What I'm trying to make happen is use spd-say in a function to make the computer talk to me.
The echo portion of my function works. It outputs both lines of text that I feed to it in the expected order. However, the spd-say part doesn't. It only ever says the last line. I'm assuming it's because the second command is "overwriting" the output of the first because it's trying to run them in parallel to the same output. I've tried adding ;wait, &&, and various other things to the end of the sez command, on the next line after, within the function on the spd-say command, etc, but everything I'm trying isn't helping.
What am I doing wrong?
bash shell-script audio function text-to-speech
I'm sure this is fairly elementary, but I can't figure it out.
My script:
#!/bin/bash
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
What I'm trying to make happen is use spd-say in a function to make the computer talk to me.
The echo portion of my function works. It outputs both lines of text that I feed to it in the expected order. However, the spd-say part doesn't. It only ever says the last line. I'm assuming it's because the second command is "overwriting" the output of the first because it's trying to run them in parallel to the same output. I've tried adding ;wait, &&, and various other things to the end of the sez command, on the next line after, within the function on the spd-say command, etc, but everything I'm trying isn't helping.
What am I doing wrong?
bash shell-script audio function text-to-speech
bash shell-script audio function text-to-speech
edited Aug 20 '18 at 22:35
Rui F Ribeiro
41.8k1483142
41.8k1483142
asked Oct 9 '16 at 15:06
lightwinglightwing
498
498
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I had a similar problem and I found a workaround. Instead of using spd-say I used espeak directly.
add a comment |
spd-say requires a suitable shell environment. cron doesn't execute tasks in your regular shell environment.
You can try changing your script such as in this example:
#!/bin/bash
source $HOME/.profile
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
See also this question for more information: http://unix.stackexchange.com/questions/67940/cron-ignores-variables-defined-in-bashrc-and-bash-profile
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f315289%2fusing-spd-say-in-a-bash-script-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had a similar problem and I found a workaround. Instead of using spd-say I used espeak directly.
add a comment |
I had a similar problem and I found a workaround. Instead of using spd-say I used espeak directly.
add a comment |
I had a similar problem and I found a workaround. Instead of using spd-say I used espeak directly.
I had a similar problem and I found a workaround. Instead of using spd-say I used espeak directly.
edited Dec 4 '16 at 14:05
Jeff Schaller♦
44.3k1162143
44.3k1162143
answered Dec 4 '16 at 10:00
alagrisalagris
465
465
add a comment |
add a comment |
spd-say requires a suitable shell environment. cron doesn't execute tasks in your regular shell environment.
You can try changing your script such as in this example:
#!/bin/bash
source $HOME/.profile
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
See also this question for more information: http://unix.stackexchange.com/questions/67940/cron-ignores-variables-defined-in-bashrc-and-bash-profile
New contributor
add a comment |
spd-say requires a suitable shell environment. cron doesn't execute tasks in your regular shell environment.
You can try changing your script such as in this example:
#!/bin/bash
source $HOME/.profile
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
See also this question for more information: http://unix.stackexchange.com/questions/67940/cron-ignores-variables-defined-in-bashrc-and-bash-profile
New contributor
add a comment |
spd-say requires a suitable shell environment. cron doesn't execute tasks in your regular shell environment.
You can try changing your script such as in this example:
#!/bin/bash
source $HOME/.profile
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
See also this question for more information: http://unix.stackexchange.com/questions/67940/cron-ignores-variables-defined-in-bashrc-and-bash-profile
New contributor
spd-say requires a suitable shell environment. cron doesn't execute tasks in your regular shell environment.
You can try changing your script such as in this example:
#!/bin/bash
source $HOME/.profile
sez ()
echo $1
spd-say "$1"
sez "does this work"
sez "this does work"
See also this question for more information: http://unix.stackexchange.com/questions/67940/cron-ignores-variables-defined-in-bashrc-and-bash-profile
New contributor
New contributor
answered 2 days ago
user344053user344053
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f315289%2fusing-spd-say-in-a-bash-script-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown