Commit graph

66 commits

Author SHA1 Message Date
Samuel Thibault
ee05f278f2 Add support for indexing 2021-06-14 20:47:04 +03:00
Alexander Epaneshnikov
7cfba0878b
Merge pull request #18 from sthibaul/range
Support pitch range configuration
2021-06-14 20:01:52 +03:00
Samuel Thibault
a9657bbb2b Support pitch range configuration
This allows to let users choose expressiveness of their synth.
2020-04-25 21:47:00 +02:00
Samuel Thibault
1e31008091 pass '\n' to espeak too for e.g. proper pause 2019-08-18 20:30:45 +02:00
Samuel Thibault
5339da3144 Support audio pauses
When the Linux console is e.g. switched to a graphical VT, the kernel
emits \x01P to notify that it is not able to read the screen any more,
and the software synthesis can thus release the audio card, for other
screen readers to take over.

This implements it by adding a paused_espeak variable that tracks
whether we have suspended espeak.  When more text comes, we can simply
reinitialize espeak.

This fixes #10.
2018-07-11 16:02:44 -05:00
Samuel Thibault
b7fe3af320 add unicode variant of /dev/softsynth 2017-03-14 21:52:14 -05:00
Christopher Brannon
d977243735 Add a missing #include, so that this can be built with musl.
This closes #5.
2015-08-18 08:45:27 -05:00
William Hubbs
d95ee07775 Revert "add indexing support"
This reverts commit e84e000b3e.
I need to think more about how to implement this.
2011-05-09 22:22:14 -05:00
William Hubbs
e84e000b3e add indexing support 2011-05-09 21:47:56 -05:00
William Hubbs
3b4b6d0cbc change code to use allocMem wrapper for memory allocation
One of the new string handling routines is a wrapper for allocating
memory. This commit changes the rest of the code to take advantage of
that wrapper.
2011-05-06 23:08:33 -05:00
William Hubbs
ba316a4cd4 separate string handling routines into their own module 2011-05-05 17:31:42 -05:00
Christopher Brannon
c06f18c454 support adapters using the acsint module 2011-05-05 17:29:25 -05:00
William Hubbs
701074fd96 go back to just using a makefile
The reason I went to autotools was the multiple sound systems, but since
we are now just using espeak's audio processing we can go back to a more
simple build system.
2011-03-06 13:09:42 -06:00
William Hubbs
056dcf70fe convert to autotools 2010-05-04 22:55:13 -05:00
William Hubbs
ac9e12414b made stop_requested a global variable
The two variables, stop_requested and runner_must_stop were performing
the same function, so I am using one variable, stop_requested for this
function.
2009-07-01 20:16:29 -05:00
William Hubbs
18ebab3247 indentation fixes 2009-07-01 19:04:01 -05:00
William Hubbs
cc7e77eb9d move stop_audio call to synth thread
Since there is no reason currently for the softsynth thread to do this,
it makes better sense to have the synth thread control all interaction
with espeak.
2009-07-01 13:01:41 -05:00
Christopher Brannon
40479540b4 Fix a memory leak.
If we fail to add entries to the queue in queue_add_cmd or
queue_add_text, properly free the entry.
2009-06-29 18:42:25 -05:00
Christopher Brannon
31ad5f04ca Completely data-agnostic queue functions.
The functions in queue.c no longer use static variables.  We can now use
them for multiple queues, if necessary.
2009-06-29 18:07:18 -05:00
William Hubbs
ceaae3640a audio should be stopped in softsynth_thread not espeak_thread 2009-06-29 15:59:55 -05:00
William Hubbs
5ec3809c59 wake up espeak_thread when softsynth_thread terminates
espeak_thread needs a signal since it might be sleeping and
should_run has changed.  This makes sure it terminates.
2009-06-25 21:17:34 -05:00
William Hubbs
5ebe506026 more mutex fixes
Make sure that should_run is protected by the mutex in the softsynth
thread.
2009-06-25 21:07:24 -05:00
Chris Brannon
d5fd5d69b8 don't wait on a condition variable if should_run is false 2009-06-25 20:39:35 -05:00
William Hubbs
dd00775695 initialization update
The main function now initializes espeak and opens the softsynth before
starting the threads.  This insures that the resources we need are
active.
2009-06-25 18:30:36 -05:00
William Hubbs
3687f16b09 wait for acknowledgements correctly
pthread_cond_wait() can have spurious wakeups, so we need to be sure
that the condition is actually true when we return from this function.
Thanks to Chris Brannon for the patch.
2009-06-25 17:05:51 -05:00
William Hubbs
975765289b made sure all cond_wait and cond_signal calls are inside lock/unlock
calls
2009-06-25 14:17:21 -05:00
William Hubbs
b8c7247feb removed acknowledge_guard and substituted queue_guard 2009-06-25 14:05:36 -05:00
William Hubbs
1091182f88 removed a debug print call 2009-06-25 12:57:29 -05:00
William Hubbs
554a03d26c white space fix 2009-06-25 12:06:33 -05:00
Christopher Brannon
b7f324072f Fix concurrency bugs.
1. Don't lock or unlock queue_guard during queue_clear.
It is locked when queue_clear is called, and it should remain so.
2. Protect runner_must_stop with queue_guard in
the request_espeak_stop function.
The following condition should always hold: queue_guard is locked while
testing or modifying runner_must_stop.
3. Rename stop_guard to acknowledge_guard.  This is a more
descriptive name.  This mutex simply protects the acknowledgement of
the stop request from being lost.
4. Remove the pthread_mutex_lock from the top of queue_process_entry,
because queue_guard is already locked when the function is called.
2009-06-25 11:56:20 -05:00
William Hubbs
a8cad20de8 more multithreading work
Rearranged the queue handling code so that queue.c is generic.  Also
rearranged several functions in the threads.
2009-06-25 09:05:21 -05:00
William Hubbs
3e8e7d12ae added back the declaration for softFD 2009-06-24 22:44:18 -05:00
William Hubbs
af5717b8cb moved queue_add_xxx functions to softsynth thread 2009-06-24 22:23:10 -05:00
William Hubbs
0fdca827b8 check for terminalFD after select()
If terminalFD has something to read, we break out of the loop in the
softsynth thread.
2009-06-24 21:29:46 -05:00
William Hubbs
474580b08b add pipe to wake up the softsynth thread
This adds a pipe to wake up the softsynth thread, in case we receive a
signal while it is in a select.  Thanks to Chris Brannon.
2009-06-24 21:16:30 -05:00
William Hubbs
c5fce64f25 removed open_softsynth and close_softsynth
The thread can now handle the softsynth device, so main doesn't need to
call these functions.
2009-06-24 20:44:42 -05:00
William Hubbs
a58f93cd74 renamed reader_thread to softsynth_thread 2009-06-24 20:19:24 -05:00
William Hubbs
9d1cabdd0d started work on multi-threading more of the program
The goal is to create threads for the reader, que runner/espeak
processing and signal handling.
As of this commit, this code is still being worked on, so it is broken.
2009-06-24 20:03:31 -05:00
William Hubbs
f58d9984ce Now the queue runner/softsynth handler clears the queue
Thanks to Chris Brannon for the patch.
2009-06-24 16:59:23 -05:00
William Hubbs
08e46c58a8 indentation fixes 2009-06-20 13:09:57 -05:00
William Hubbs
d7dd0f919d fixed initialization issues
We were not returning exit codes properly if we were unable to open the
softsynth or if the daemon was already running.
2009-05-30 12:37:58 -05:00
William Hubbs
d7c81f5117 indentation fixes 2009-05-29 23:17:28 -05:00
Christopher Brannon
3ddbb94e37 multithreading
Make espeakup a multi-threaded program.  One thread reads from the softsynth
device, queuing text and synthesis commands.  The other thread processes
items from the queue.
2009-05-29 20:00:06 -05:00
William Hubbs
3dbdcb21cb Aespeakup should not drop all non-ascii characters.
This fixes an issue with non-english languages.
Thanks to Samuel Thibault for the patch.
2009-04-05 19:24:36 -05:00
William Hubbs
bbf77d918d Cleaned up warnings and adjusted CFLAGS
This commit cleans up warnings and adjusts CFLAGS.  Thanks to
samuel.thibault@ens-lyon.org.
2009-03-03 18:02:19 -06:00
William Hubbs
a3901a7e4c fixed a bug in process_command
One of the switch statements in process_command did not have a default
label, which lead to undefined behavior.
Thanks to Chris Brannon for the patch.
2008-10-22 19:17:03 -05:00
William Hubbs
36b05aec41 Added support for the punctuation command from speakup 2008-10-18 16:56:47 -05:00
William Hubbs
d7e8dc2b34 Revert "fixed the length calculation when a flush is processed."
This reverts commit 66cb5a7b5c.
2008-10-09 09:05:56 -05:00
William Hubbs
66cb5a7b5c fixed the length calculation when a flush is processed. 2008-10-09 08:17:07 -05:00
William Hubbs
62deb008bc fixed the number of bytes to move in the memmove() call 2008-10-09 07:58:58 -05:00