pause speech synthesizer from my code

Asked by Faby on 2010-07-02

Hello everyone,

I am presently working on speech synthesis on Ubuntu 10.04. So far I've been using festival but I discovered espeak by reading other people's previous questions and answers. My main goal is to develop a communication system whereby festival or espeak can speak to the end user and also can be paused/temporarily stopped if given a command from the user. I know that while using the interactive section of festival, one can pause using ctrl+z but I want another means to pause festival. I'll give a brief example:

--from my code festival is given a file to read:- less example.txt | festival --tts
            (so it starts reading the file)

--then from my code, I want to give a command that will pause festival...

--thereafter, from my code, I want to continue running festival from where it stopped reading.

Please anyone who has a clue to this will make my day.

Thanks in advance!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu espeak Edit question
Assignee:
No assignee Edit question
Last query:
2010-07-03
Last reply:
2010-07-04

You may be able to put the process to sleep

http://linux.about.com/library/cmd/blcmdl3_sleep.htm

The user will have rights over the process as the user launched it. May help

Faby (talk2ndu2002) said : #2

thanks actionparsnip. This might somewhat help. is there an opposite command for sleep?

sleep takes an integer value for seconds but i think it just makes a pause in a script rather than making a process pause. Let me websearch more

This looks perfect for your needs:

http://tombuntu.com/index.php/2007/11/23/how-to-pause-a-linux-process/

pause with:
kill -STOP PID

resume with:
kill -CONT PID

Faby (talk2ndu2002) said : #4

thanks I had actually tried something similar kill - SIGSTOP PID and kill -CONT PID but they they didn't really work as wanted in the sense that the process was not stopped even when I used the pid.

I really appreciate your help. Please if you can help me got some other commands.

Thanks a lot! :)

You need to replace PID with the actual pid of the process. You can gain this by running:

pidoff process

replace 'process' with the process name

Can you help with this problem?

Provide an answer of your own, or ask Faby for more information if necessary.

To post a message you must log in.