brailcom/speechd

espeak-ng not set to default speech synthesis engine

Closed this issue · 99 comments

Steps to reproduce

Install espeak-ng. spd-conf -u, set espeak-ng as default speech synthesis engine.

Obtained behavior

spd-say -) lists espeak-ng-mbrola. I never installed espeak-ng-mbrola that I am aware of.

Expected behavior

speech-dispatcher to work as it used to.

Behavior information

Please follow the next step, to provide us with precious information about how things went wrong on your machine:

  • Set LogLevel to 5 in your /etc/speech-dispacher/speechd.conf
  • Restart your computer to make sure it gets taken into account
  • Reproduce the issue
  • Make a copy of the speech-dispacher.log file, it is usually found in /run/user/1000/speech-dispatcher/log. Also make a copy of yourspeechmodule.log (e.g. espeak-ng.log).
  • Set LogLevel back to 3 in your /etc/speech-dispacher/speechd.conf
  • Attach the speech-dispatcher.log and yourspeechmodule.log file to your bug report.

[Fri Apr 7 21:34:50 2023 : 166111] speechd: Error: Module reported error in request from speechd (code 3xx): 300-Opening sound device failed. Reason: Cannot open plugin pulse. error: file not found.
300 MODULE ERROR
.
[Fri Apr 7 21:34:50 2023 : 166133] speechd: ERROR: Can't initialize audio in output module, see reason above.
[Fri Apr 7 21:34:50 2023 : 166224] speechd: Speech Dispatcher Logging to file /run/user/999/speech-dispatcher/log//speech-dispatcher.log
[Fri Apr 7 21:34:50 2023 : 166263] speechd: Error [speechd.c:672]:No speech output modules were loaded - aborting...

Distribution

Xubuntu 22.04

Version of Speech-dispatcher

speech-dispatcher 0.11.1

I also tried building speech-dispatcher from this repository. Different error, still no voices.

I initially observed this testing window.speechSynthesis.speak().

I see, spd-conf was not able to set DefaultModule because of a mere missing space.

You can fix your configuration by editing .config/speech-dispatcher/speechd.conf, finding the line where DefaultModule is set, and drop the # character that is at the beginning of it.

That is one part of the issue. The other part is speech-dispatcher does not want to autospawn. So where I would normally see speech-dispatcher-espeak-ng in Pulse Audio controls persistently it ain't there at all, so no sounf is output when I use speechSynthesis.speak().

The other part is speech-dispatcher does not want to autospawn

We'd need the real full logs to determine what is happening.

[Sat Apr  8 08:38:54 2023 : 973935] speechd: Exec of module "/usr/local/libexec/speech-dispatcher-modules/sd_espeak-ng" with config "/home/xubuntu/.config/speech-dispatcher/modules/espeak-ng.conf" failed with error 2: No such file or directory

That's odd, it seems it's getting configuration files wrongly. Could you increase LogLevel to 5 in speechd.conf and retry, so we get to know how things are going exactly?

Alright, I set LogLevel to 5 in ~/.config/speech-dispatcher/speechd.conf and ran speech-dispatcher restart. What should I do now?

well, try again to trigger auto-spawn? And post the resulting log file

I just ran speech-dispatcher -a and speech-dispatcher-espeak-ng is not showing up in Pulse Audio audio mixer (pavu). I've uninstalled

sudo apt --purge remove python3-speechd speech-dispatcher-espeak-ng espeak-ng

and reinstalled

sudo apt install remove python3-speechd speech-dispatcher-espeak-ng espeak-ng

and built speechd from a downloaded tarball of this repository. I am ready to start from scratch again if that what is needed.

I'm just conveying to you something is a foot. speech-dispatcher used to just work for speech synthesis interface to Web Speech API.

$ speech-dispatcher -a
[Sat Apr  8 09:18:51 2023 : 105594] speechd: Speech Dispatcher 0.11.4 starting

$ spd-say test
Failed to connect to Speech Dispatcher:
Error: Can't connect to unix socket /run/user/999/speech-dispatcher/speechd.sock: Connection refused. Autospawn: Autospawn failed. Speech Dispatcher refused to start with error code, stating this as a reason: 
[Sat Apr  8 09:18:51 2023 : 106717] speechd:    Reading configuration for pattern emacs:*
[Sat Apr  8 09:18:51 2023 : 106768] speechd:  Configuration has been read from "/home/xubuntu/.config/speech-dispatcher/speechd.conf"
[Sat Apr  8 09:18:51 2023 : 106844] speechd:  Initializing output module espeak-ng with binary /usr/local/libexec/speech-dispatcher-modules/sd_espeak-ng and configuration /home/xubuntu/.config/speech-dispatcher/modules/espeak-ng.conf
[Sat Apr  8 09:18:51 2023 : 106865] speechd:   Output module is logging to file /run/user/999/speech-dispatcher/log//espeak-ng.log
[Sat Apr  8 09:18:51 2023 : 107391] speechd:  Module espeak-ng loaded.
[Sat Apr  8 09:18:51 2023 : 107431] speechd:    Trying to initialize espeak-ng.
[Sat Apr  8 09:18:51 2023 : 107460] speechd:     Command sent to output module: |INIT
| (0)
[Sat Apr  8 09:18:51 2023 : 107488] speechd: Exec of module "/usr/local/libexec/speech-dispatcher-modules/sd_espeak-ng" with config "/home/xubuntu/.config/speech-dispatcher/modules/espeak-ng.conf" failed with error 2: No such file or directory
[Sat Apr  8 09:18:51 2023 : 107955] speechd: ERROR: Bad syntax from output module espeak-ng 1
[Sat Apr  8 09:18:51 2023 : 108054] speechd:   Speech Dispatcher Logging to file /run/user/999/speech-dispatcher/log//speech-dispatcher.log
[Sat Apr  8 09:18:51 2023 : 108077] speechd: Error [speechd.c:672]:No speech output modules were loaded - aborting...
[Sat Apr  8 09:31:50 2023 : 203742] speechd:   Speech Dispatcher Logging to file /run/user/999/speech-dispatcher/log//speech-dispatcher.log
[Sat Apr  8 09:31:50 2023 : 203853] speechd:     Will load symbol file gender-neutral.dic
[Sat Apr  8 09:31:50 2023 : 203875] speechd:     Will load symbol file font-variants.dic
[Sat Apr  8 09:31:50 2023 : 203897] speechd:     Will load symbol file symbols.dic
[Sat Apr  8 09:31:50 2023 : 203920] speechd:     Will load symbol file emojis.dic
[Sat Apr  8 09:31:50 2023 : 203942] speechd:     Will load symbol file orca.dic
[Sat Apr  8 09:31:50 2023 : 203963] speechd:     Will load symbol file orca-chars.dic
[Sat Apr  8 09:31:50 2023 : 204010] speechd:     Module name=espeak-ng being inserted into requested_modules list, with 'sd_espeak-ng' 'espeak-ng.conf' '/run/user/999/speech-dispatcher/log//espeak-ng.log' '(null)' '(null)'
[Sat Apr  8 09:31:50 2023 : 204162] speechd:    Reading configuration for pattern emacs:*
[Sat Apr  8 09:31:50 2023 : 204213] speechd:  Configuration has been read from "/home/xubuntu/.config/speech-dispatcher/speechd.conf"
[Sat Apr  8 09:31:50 2023 : 204293] speechd:  Initializing output module espeak-ng with binary /usr/local/libexec/speech-dispatcher-modules/sd_espeak-ng and configuration /home/xubuntu/.config/speech-dispatcher/modules/espeak-ng.conf
[Sat Apr  8 09:31:50 2023 : 204313] speechd:   Output module is logging to file /run/user/999/speech-dispatcher/log//espeak-ng.log
[Sat Apr  8 09:31:50 2023 : 204841] speechd:  Module espeak-ng loaded.
[Sat Apr  8 09:31:50 2023 : 204885] speechd:    Trying to initialize espeak-ng.
[Sat Apr  8 09:31:50 2023 : 204914] speechd:     Command sent to output module: |INIT
| (0)
[Sat Apr  8 09:31:50 2023 : 204964] speechd: Exec of module "/usr/local/libexec/speech-dispatcher-modules/sd_espeak-ng" with config "/home/xubuntu/.config/speech-dispatcher/modules/espeak-ng.conf" failed with error 2: No such file or directory
[Sat Apr  8 09:31:50 2023 : 205465] speechd: ERROR: Bad syntax from output module espeak-ng 1
[Sat Apr  8 09:31:50 2023 : 205558] speechd:   Speech Dispatcher Logging to file /run/user/999/speech-dispatcher/log//speech-dispatcher.log
[Sat Apr  8 09:31:50 2023 : 205586] speechd: Error [speechd.c:672]:No speech output modules were loaded - aborting...

Could you also post your /home/xubuntu/.config/speech-dispatcher/speechd.conf?

I really don't understand why it's trying to open the configuration file from your user directory...

Could you try with the latest master and post the resulting log file?

Could you try with the latest master and post the resulting log file?

You mean building speech-dispatcher?

How do I make sure I get rid of all speech-dispatcher artifacts on the system?

It looks like the program is having issues autospawning.

You mean building speech-dispatcher?

Yes.

How do I make sure I get rid of all speech-dispatcher artifacts on the system?

You can for instance uninstall the system package

It looks like the program is having issues autospawning.

It's not the autospawn the problem, but the start of speech-dispatcher itself:

No speech output modules were loaded - aborting...

Will your speech-dispatcher-0.11.4 unarchived work for the build? Any flags I need to pass to configure of make?

Will your speech-dispatcher-0.11.4 unarchived work for the build?

I don't understand this.

Any flags I need to pass to configure of make?

Default parameters should be just fine (otherwise it would be a bug...)

Is there any reason ./configure --with-espeak-ng says it can't find espeak-ng even though the package is installed?

checking for espeak_Synth in -lespeak... no
checking for espeak-ng... no
configure: error: in `/home/xubuntu/Downloads/speech-dispatcher-0.11.4':
configure: error: espeak-ng is not available
See `config.log' for more details

See `config.log' for more details

configure:22972: checking for espeak-ng
configure:22979: $PKG_CONFIG --exists --print-errors "espeak-ng"
Package espeak-ng was not found in the pkg-config search path.
Perhaps you should add the directory containing `espeak-ng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'espeak-ng' found

Not sure how that is possible. espeak-ng is right there in /usr/bin

Compiled

$ spd-say -O
OUTPUT MODULES


How do I set `espeak-ng` as the default output module?

Interesting

$ spd-conf -u
Traceback (most recent call last):
  File "/usr/local/bin/spd-conf", line 22, in <module>
    import speechd_config
ModuleNotFoundError: No module named 'speechd_config'

Not sure how that is possible. espeak-ng is right there in /usr/bin

It's not looking for the espeak-ng program, but for the espeak-ng library, necessary to be able to build the espeak-ng sd module at all. You needs to install the development package of espeak-ng, something like libespeak-ng-dev.

ModuleNotFoundError: No module named 'speechd_config'

Your distribution is probably missing adding /usr/local/lib/python3.11/site-packages to your PYTHONPATH

WHy is all of this happening all of a sudden? Not that long ago I could just install python3-speechd, espeak-ng with apt, run spd-conf -u and be done with the matter.

$ sudo apt install libespeak-ng-dev
$ spd-conf -u
Traceback (most recent call last):
  File "/usr/local/bin/spd-conf", line 22, in <module>
    import speechd_config
ModuleNotFoundError: No module named 'speechd_config'

WHy is all of this happening all of a sudden? Not that long ago I could just install python3-speechd, espeak-ng with apt, run spd-conf -u and be done with the matter

You uninstalled python3-speechd, didn't you?

$ sudo apt install libespeak-ng-dev
$ spd-conf -u

libespeak-ng-dev is needed at the ./configure step. You need to restart from there.

Same error is thrown for spd-conf -u.

Installing libespeak-ng-dev is not meant to fix spd-conf -u, but to fix building the espeak-ng sd module. Does spd-say -O mention espeak-ng now?

Concerning spd-conf -u, as I mentioned you need to set your PYTHONPATH since apparently your distrib doesn't do it for you. Something like

export PYTHONPATH=/usr/local/lib/python3.11/site-packages

of course in that example you need to fix the path according to where speechd_config ended up.

of course in that example you need to fix the path according to where speechd_config ended up.

How do I determine that?

Does spd-say -O mention espeak-ng now?

Yes.

How do I determine that?

Well, look at what is there in /usr/local/lib etc.

Got it working in the browser. Is this an anamoly or something that should be jotted down as installation notes?

Got it working in the browser

Did you do anything particular to get it working?

Follow the instructions in this issue and finally

export PYTHONPATH=/usr/local/lib/python3.10/site-packages

followed by

spd-conf -u

then tested with https://guest271314.github.io/SSMLParser/.

It didn't use to be this complicated.

I have something like this in a startup script I run when I boot a new live-CD

sudo apt-get -y install libtool \
libcurl4-openssl-dev \
texinfo \
cmake \
bleachbit \
espeak-ng \
python3-speechd \
mpv \
git \
libssl-dev \
build-essential

I ran this code https://edvins.io/react-text-to-speech the other day and afterwards speechSynthesis.speak() didn't want to work.

Sure enough, after trying to run the code on this page https://edvins.io/react-text-to-speech speech-dispatcher-espeak-ng disappears from Pulse Audio audio mixer control, and spd-say test doesn't output audio any more. Using window.speechSynthesis.speak() shouldn't be able to mess with speech-dispatcher like that. What is going on?

What is going on?

As usual, the logs will tell us.

It didn't use to be this complicated.

That's just because in this case we have been installing by hand to try to debunk what's getting wrong with your distribution-provided version.

Please remember to set LogLevel to 5, otherwise the log doesn't contain precious information for debugging

and ideally, remove the log files before starting your test, so that the log only contains information about your test

I think something on the linked page is breaking speech-dispatcher. Never observed that happen before where calling speechSynthesis.speak() and resume() makes speech-dispatcher-espeak-ng disappear from the Pulse Audio Playback page.

That is what lead me here to file this issue.

I removed the file speech-dispatcher.log from /run/user/999/speech-dispatcher/log.

It's is not getting recreated after speech-dispatcher restart. I think I can get speech-dispatcher working again by re-building after the audio stops working.

Not sure how that log file get recreated.

speech-dispatcher restart

What do you mean exactly by this? If you are also running a root-started speech-dispatcher, we'll get lost between your user's speech-dispatcher and root's speech-dispatcher. Autospawn does not need a root-started speech-dispatcher.

I don't see a way to restart speech-dispatcher in option so that's what I have been using.

I just re-created the log file in /log.

Then ran speech-dispatcher -l 5.

Audio just stopped when I pushed pause and then resume on the page that is causing the issue.

Nothing is witten to the speech-dispatcher.log file. So I need instructions on how to re-create that file, and re-start speech-dispatcher after setting LogLevel to 5.

I don't see a way to restart speech-dispatcher in option so that's what I have been using.

where that is what? Please actually answer my questions otherwise I have no idea what you are actually doing.

If you want to kill an existing speech-dispatcher you can just run killall speech-dispatcher

I just re-created the log file in /log.

That won't help. speech-dispatcher knows to create the log whenever it needs to. But for that to happen you need to avoid a root-started speech-dispatcher. E.g. use systemctl stop speech-dispatcher

I need instructions on how to re-create that file

No, you don't need to create it

and re-start speech-dispatcher after setting LogLevel to 5

No, you don't want to restart it, you want to kill the existing instance. So that auto-spawn actually happens just the way you had it at the very very beginning of this whole issue tracking.

What do you mean exactly by this?

where that is what? Please actually answer my questions otherwise I have no idea what you are actually doing.

I'm trying to restart speech-dispatcher.

Alright. I think I followed the instructions and here is the log file. Let me know if I missed something.

What happens is TTS audio stops being output altogether after I press play and pause then resume here https://edvins.io/react-text-to-speech. Which means this https://guest271314.github.io/SSMLParser/ doesn't output audio after I press play, pause , then resume on the above site.

speech-dispatcher.log

Looks like speech-dispatcher is breaking on speechSynthesis.pause() on Chromium 114.

speechSynthesis.pause() worked once on Firefox Nightly 113, then didn't work at all afterwards.

here is the log file

Ok, but a log of what test? All I can see there is two calls to spd-say yo , was there actually a bug while doing it?

I'm obviously on Linux. Each time I call speechSynthesis.pause() I have to restart everything, kill speech-dispatcher and run speech-dispatcher -a then I test with spd-say yo before trying on a Web page.

Please really please proceed methodologically, otherwise I have no idea what the log is all about.

I need:

a log file corresponding to the bogus situation.

I don't need a log file of the case where things work fine. What I need is observing how speech-dispatcher is behaving wrongly. Showing me the working case won't help me at all understanding the issue.

run speech-dispatcher -a then I test with spd-say yo before trying on a Web page

Why running with -a? Does autospawn not work when loading the web page?

Really, I need you to be precise in your reports, otherwise I'm just completely lost at what you are doing.

I set LogLevel to 5.

I uploaded the log file.

I'm testing on Chromium 114 Dev Channel with --enable-speech-dispatcher flag passed.

espeak-ng is installed and is set as speech synthesis engine.

Steps to reproduce:

What happens here is the synthesis playback is not resumed. Thereafter no speech synthesis audio is aoutput period until I (re-build), kill speech-dispatcher then re-start speech-dispatcher.

I just happened to stumble across this issue.

Ok thanks but now I need the log file of that situation.

I already uploaded it.

I'll repeat the steps, again.

Should be the last entries. I didn't delete the original log file before just going in.
speech-dispatcher.log

Were you able to reproduce the issue?

Thanks to your log file, I'm on something, yes

Could you try the current master? I indeed spotted a missing event.

Now, that being said, there is still this question: “Why running with -a? Does autospawn not work when loading the web page?”

To solve this I'd need a log in the case of loading the web page + playing, but speech-dispatcher doesn't autospawn

I'll try the current master.

Now, that being said, there is still this question: “Why running with -a? Does autospawn not work when loading the web page?”

Because speechSynthesis.pause() being called caused this issue (whatever was autospawned by the browser went away) and I was trying ways to restart (reset) speech-dispatcher.

Building from github repository:

git clone https://github.com/brailcom/speechd
cd speechd
./build.sh
./configure --with-pulse --with-espeak-ng
 export PYTHONPATH=/usr/local/lib/python3.10/site-packages
spd-conf -u
Traceback (most recent call last):
  File "/usr/local/bin/spd-conf", line 22, in <module>
    import speechd_config
  File "/usr/local/lib/python3.10/site-packages/speechd_config/__init__.py", line 16, in <module>
    from speechd_config.config import *
  File "/usr/local/lib/python3.10/site-packages/speechd_config/config.py", line 32, in <module>
    from xdg import BaseDirectory
ModuleNotFoundError: No module named 'xdg'

Then install python3-xdg?

Now, that being said, there is still this question: “Why running with -a? Does autospawn not work when loading the web page?”

Because speechSynthesis.pause() being called caused this issue (whatever was autospawned by the browser went away) and I was trying ways to restart (reset) speech-dispatcher.

Ok, but I mean: you should only need to run killall speech-dispatcher. After that everything should be working fine without having to start speech-dispatcher by hand with -a.

If that's not the case, there's a remaining bug that we need to fix

I didn't know that. I had no roadmap for this issue. Didn't even know there was an issue until clicking pause button on the linked Web site. At first I thought it was the React application - then realized, no, this is deeper than a wrapper around Web Speech API. The socket connection should not be closing just because pause() is called.

Why is the version build from the repository printing version 0.11.3? Before I click pause on the Web page, or just do the test on another page, I want to make sure I have the GitHub repository version installed.

If I did everything correctly this is still broken.

Why is the version build from the repository printing version 0.11.3?

Because I don't necessarily take the time to bump the version in git. I have now done so.

If I did everything correctly this is still broken.

Then I need another log

Ok, that was a different case, now also fixed, could you test the newer master?

speech-dispatcher --version
speech-dispatcher 0.11.3+dev

Not much changed. pause() stops playback. resume() does nothing. Thereafter no synthesis is output to speakers until after killall -9 speech-dispatcher.

speechd must be storing this data (the generated WAV) file somewhere internally - with associated data conveying where the output was stopped - as I'm rather sure espeak-ng does not have a pause mechanism?

speech-dispatcher.log

resume() does nothing

? Your log file doesn't include any RESUME command coming from the client, are you sure you really caught it?

speechd must be storing this data (the generated WAV) file somewhere internally

Yes.

I'm rather sure espeak-ng does not have a pause mechanism?

It does have a way to stop the synthesis.

Yes. I called resume().

I simply ran this at console

let u = new SpeechSynthesisUtterance();
u.text = 'test '.repeat(200);
speechSynthesis.speak(u);
// ...wait a few seconds
speechSynthesis.pause();
speechSyntehsis.resume();

Here, I'll repeat (same log file). BTW pause() takes around 1-2 seconds to actually pause. resume() still does nothing, and calling speak() thereafter does nothing.

speech-dispatcher.log

I don't see a RESUME command either - anywhere in the log file

[Sun Apr  9 17:12:15 2023 : 374513] speechd:     Event from output module while speaking: |705-bits=16
705-num_channels=1
705-sample_rate=22050
705-num_samples=154
705-big_endian=0
705-AUDIO|
[Sun Apr  9 17:12:15 2023 : 374531] speechd:     Received event:
 705-bits=16
705-num_channels=1
705-sample_rate=22050
705-num_samples=154
705-big_endian=0
705-AUDIO
[Sun Apr  9 17:12:15 2023 : 374549] speechd:     Got audio: 419 bytes
[Sun Apr  9 17:12:15 2023 : 374566] speechd:     Discarding audio still coming from the synth
[Sun Apr  9 17:12:15 2023 : 374585] speechd:     output_module_is_speaking()
[Sun Apr  9 17:12:15 2023 : 374618] speechd:     Got 8 bytes from output module over socket
[Sun Apr  9 17:12:15 2023 : 374636] speechd:     Event from output module while speaking: |702 END
|
[Sun Apr  9 17:12:15 2023 : 374655] speechd:     Received event:
 702 END

[Sun Apr  9 17:12:15 2023 : 374672] speechd:     got end
[Sun Apr  9 17:12:15 2023 : 374688] speechd:    we sent STOP too late, now tell the speak queue
[Sun Apr  9 17:12:15 2023 : 374707] speechd:    speak_queue stopping...
[Sun Apr  9 17:12:15 2023 : 374762] speechd:    speak_queue Stop or pause.
[Sun Apr  9 17:12:15 2023 : 374795] speechd:    speak_queue Stopping audio.
[Sun Apr  9 17:12:15 2023 : 374819] speechd:    finished getting data from output module
[Sun Apr  9 17:12:15 2023 : 375999] speechd:    speak_queue Sent to audio.
[Sun Apr  9 17:12:15 2023 : 376091] speechd:    speak_queue playback thread detected stop.
[Sun Apr  9 17:12:15 2023 : 379959] speechd:    speak_queue Waiting for synthesis to stop.
[Sun Apr  9 17:12:15 2023 : 380015] speechd:    speak_queue Clearing playback queue.
[Sun Apr  9 17:12:15 2023 : 380120] speechd:    speak_queue Stop or pause thread ended.......

[Sun Apr  9 17:12:15 2023 : 380159] speechd:     Poll in speak() returned socket activity, main_pfd revents=0, poll_pfd revents=1
[Sun Apr  9 17:12:15 2023 : 380179] speechd:     wait_for_poll: activity on output_module: 1
[Sun Apr  9 17:12:15 2023 : 380196] speechd:     is_sb_speaking(), SPEAKING=1
[Sun Apr  9 17:12:15 2023 : 380229] speechd:     INDEX MARK: __spd_stopped
[Sun Apr  9 17:12:15 2023 : 380253] speechd:     34:REPLY:|703-1
703-1
703 CANCELED
|
[Sun Apr  9 17:12:15 2023 : 380294] speechd:     Locking element_free_mutex in speak()
[Sun Apr  9 17:12:15 2023 : 380316] speechd:     No message in the queue
[Sun Apr  9 17:12:15 2023 : 380336] speechd:     Poll in speak() returned socket activity, main_pfd revents=1, poll_pfd revents=1
[Sun Apr  9 17:12:15 2023 : 380353] speechd:     wait_for_poll: activity in Speech Dispatcher
[Sun Apr  9 17:12:15 2023 : 380372] speechd:     Locking element_free_mutex in speak()
[Sun Apr  9 17:12:15 2023 : 380390] speechd:     No message in the queue

Chromium seems to be bugged, see the various reports:

https://bugs.chromium.org/p/chromium/issues/list?q=speechsynthesis%20pause&can=2

I found in the source where the issue is, will post a patch there.

After looking more in the chromium source, I can confirm that the logic there was really broken.
I have submitted https://bugs.chromium.org/p/chromium/issues/detail?id=1432042

Not shocked.

Chromium authors banned me from contributing on their bugs site.

W3C and WICG banned me from contributing to their specification repositories on GitHub.

I'm on Linux using espeak-ng speech synthesis engine, which AFAICT does not provide a means to pause and resume audio output. (We are not dealing with <br> in SSML which Web Speech API doesn't support anyway.)

So whatever "fix" that is proposed must therefore store the audio somewhere, and keep track of where the pause occurred. You will need to implement an internal WAV player to do that as espeak-ng does not output raw PCM either.

The Web Speech API is broken. Clearly.

I havn't observed any movement there re SSML input; capturing audio output; etc. Certainly no movement in the implementation.

I have been using Native Messaging to send command from the browser and send stdout from espeak-ng to the browser. From my perspective Far simpler and direct. espeak-ng authors evidently had an issue understanding what I was doing espeak-ng/espeak-ng#1598.

Now I am trying to compile espeak-ng to WASI/WebAssembly. To provide a means to use espeak-ng in the browser - or other environments - unambiguously; set all conjecture to rest.

Thanks for following up on this!

I look forward to testing the solution you propose.

espeak-ng speech synthesis engine, which AFAICT does not provide a means to pause and resume audio output

It does not indeed, but

You will need to implement an internal WAV player

speech-dispatcher already makes espeak-ng provide the wave pieces, and then it can pause&resume.

speech-dispatcher already makes espeak-ng provide the wave pieces, and then it can pause&resume.

How though?

Where is speech dispatcher's internal media player code?

speech-dispatcher already makes espeak-ng provide the wave pieces, and then it can pause&resume.

There is no way for you to guarantee said "pieces" received by speech-dispatcher will correspond with when the user in the browser calls pause().

How though?

It uses AUDIO_OUTPUT_SYNCHRONOUS and espeak_SetSynthCallback to get the wav pieces.

Where is speech dispatcher's internal media player code?

src/audio/

There is no way for you to guarantee said "pieces" received by speech-dispatcher will correspond with when the user in the browser calls pause().

Indexing is used for that.

I'm skeptical.

I don't see pause mentioned in https://github.com/brailcom/speechd/blob/master/src/audio/pulse.c.

I don't see pause mentioned in https://github.com/brailcom/speechd/blob/master/src/audio/pulse.c.

You asked for the player, I answered about the player. Pausing with indexing is implemented in src/common/speak_queue.c

I'm still skeptical until I observe this working.

Should work on Firefox right now if it works, right?

You might as well file the issue and write up the fix for Firefox, too. speechSynthesis.pause() has no effect on Firefox Nightly 113.

At least calling the method does not make it so speech-dispatcher has to be terminated and restarted.

Should work on Firefox right now if it works, right?

No, Firefox didn't implement pausing at all in its Linux backend.

calling the method does not make it so speech-dispatcher has to be terminated and restarted

Why does it have to be terminated and restarted? Does pause() not just do nothing?

No, Firefox didn't implement pausing at all in its Linux backend.

It's in the specification. That's what this is about. Implementing the specification, limited as it may be, and webcompat.

So if a user is on Mac, Linux, Windows, Chrome, Chromium, Firefox, etc., we get the same result and output on the front-end at the browser.

Why does it have to be terminated and restarted? Does pause() not just do nothing?

Because after pause() is called speech synthesis audio output doesn't work at all.

It's in the specification

That doesn't make it magically implemented in firefox on Linux :)

Because after pause() is called speech synthesis audio output doesn't work at all.

Uh, that's a bug in the generic firefox layers then, that even when the os-specific part is not implemented, the generic layer misbehaves.

That doesn't make it magically implemented in firefox on Linux :)

That doesn't make it magically implement in this case either.

I have no evidence this pause(), resume() works, or will work, at all on Chromium Dev Channel right now.

Uh, that's a bug in the generic firefox layers then, that even when the os-specific part is not implemented, the generic layer misbehaves.

Then file the appropriate bug report(s) to fix the issue on Firefox.

I'm only filing this issues based on benevolence. I concluded long ago the Web Speech API is broken. Nonetheless I am obligated to notify the relevant stakeholders their code is broken, or their interface winds up being broken because of somebody else's broken source code. I use one of the broances here https://github.com/guest271314/native-messaging-espeak-ng then I can input SSML, stream, pause and play at an HTML element, and/or capture and record the audio output of the speech synthesis engine, which to me means the reason this is not implemented in browsers is purely a lack of will to do so - particularly where Google implements SSML parsing for its remote service https://github.com/guest271314/GoogleNetworkSpeechSynthesis yet no for Web Speech API implementation on Chromium or Chrome.

Thank you for your due diligence in this matter all the same.

Take the time to read the article linked from Build a Text-to-Speech component in React. The author of the article focuses on creating a "React component". They might have tested on MacOS. They could not have tested on a Linux box with speech-dispatcher, therefore have no clue the code winds up breaking on Chromium on Linux. I don't think the author has any idea how Web Speech API actually works via a socket connection on Linux.

That's not your fault. The best I can do is notify the relevant parties and stakeholers clicking pause() results in unexpected behaviour on Chromium on Linux.

Evidently Firefox hasn't even wired up pause() or resume() to see if that breaks there, too.

Here we are. 2023. SSML is parsed via remote service yet not parsed in Web Speech API. pause() and resume() don't work out of the box.

I'm only filing this issues based on benevolence

I'm only maintaining speech-dispatcher based on benevolence.

I have no evidence this pause(), resume() works, or will work, at all on Chromium Dev Channel right now.

It doesn't without my patch. It does with my patch. If you don't believe me, then too bad for you.

Take the time to read the article

No.

Then file the appropriate bug report(s) to fix the issue on Firefox

No

People cannot just throw issues at me and hope that I'll magically find time to manage them.

If you don't believe me, then too bad for you.

I don't believe any claim. I deal with facts, not hope, superstition or mere belief. The scientific method requires a competitor to reproduce claims in order to verify an emergent truth.

People cannot just throw issues at me and hope that I'll magically find time to manage them.

At least we both know you are aware of the issue with pause() in Firefox.

I don't believe any claim. I deal with facts, not hope, superstition or mere belief.

The fact is that it worked on my computer with the proposed chromium patch. If you don't believe that I was able to assert that properly, I can't do much for you except hoping that perhaps you'll consider building chromium with the patch by yourself and see by yourself.

At least we both know you are aware of the issue with pause() in Firefox.

Yes, which means I'll just ignore any requests about pausing when it's about firefox' web speech API.

Really, you need to talk with somebody about your behavior. I'm now really not surprised you got kicked out from various places.

My behavior?

I graciously thanked you earlier for dealing with this issue. I mean that.

I am a primary source researcher and historian. Mere belief is the enemy. Facts cannot be disputed.

I'm not on these boards to make friends.

I'm here to shed light on what's broken to fix those matters, and fix them myself if I can.

Chromium authors need to fix Web Speech API implementation. If I'm going to build Chromium I'm going to change a lot of things. That's not the point though.

Really, you need to talk with somebody about your behavior. I'm now really not surprised you got kicked out from various places.

That's because those organization are weak. Weak minded and weak institutionally when they can't handle constructive feedback and vetting of their claims.

I thank you, again, for your efforts in this matter.

Yes, which means I'll just ignore any requests about pausing when it's about firefox' web speech API.

That is just misplaced malice and an overt reprisal. That's your issue. I can and do just use a local server or Native Messaging for speech synthesis - because as you can see Chromium authors closed your issue as a duplicate to a 2016 issue that has not been fixed. As I said, Web Speech API is broken, and so far only you have been trying to fix things on the interface side that I can see.

Really, you need to talk with somebody about your behavior. I'm now really not surprised you got kicked out from various places.

A whole bunch of weak individuals and organizations, documented here https://github.com/guest271314/banned.

My behavior?

I graciously thanked you earlier for dealing with this issue. I mean that.

Thanking can't heal the abrupt ways of presenting things before.

That's because those organization are weak

They aren't that weak since they managed to kick. It's really not an easy thing to kick people.

I'll just ignore any requests about pausing when it's about firefox' web speech API.

That is just misplaced malice and an overt reprisal

No, it's just managing my free time. It cannot disperse myself in various places and software, I'm already torn apart between various maintenance roles. I have to focus on them, otherwise I won't be able to actually manage to release anything (see how often I get to release speech-dispatcher...).

as you can see Chromium authors closed your issue as a duplicate to a 2016

They didn't close the issue, they merged them.

Thanking can't heal the abrupt ways of presenting things before.

What are you talking about?

I have been only professional here. I have not called you out of your name, no rancor, or anything else.

I can't help it if you are sensitive and have emotional problems. There's nothing to heal from. If you think you have suffered an emotional injury that's on you. I'm not here to kowtow or hand out atta boy's.

They aren't that weak since they managed to kick. It's really not an easy thing to kick people.

They are absolutely weak. Weak minded individually. Weak organizationally, weak institutionally. Can't even handle constructive feedback. Think they are doing somebody a favor for fielding reports about their broken code, errors, or omissions. They are not, neither are you doing me any favors. I filed this issue for the good of the Web in general. I already wrote my own code to handle speech synthesis processing.

No, it's just managing my free time. It cannot disperse myself in various places and software, I'm already torn apart between various maintenance roles. I have to focus on them, otherwise I won't be able to actually manage to release anything (see how often I get to release speech-dispatcher...).

O.k.

It's evidently too much for you to handle to file bugs in venues that implement your releases when those venues don't implement it right.

Just means Firefox doesn't officially know their code is broken, and have no fix. Nothing novel there. Web Speech API has been broken for years.

They didn't close the issue, they merged them.

Right. They closed your issues, merged that issue into a 6 year old issue. That is evidence of a lack of will to fix the bug in Chromium/Chrome world. I certainly ain't waiting around for Chromium authors, Firefox authors, you, or anybody else to implement working code. I just execute the speech synthesis engine directly controlled from the browser.

I'm only following up on these bugs for the greater good of the whole Web; particularly for folks who actually are using the Web Speech API; accessibility; webcompat.

What are you talking about?

Various comments in your postings, e.g.

“I'm just conveying to you something is a foot”

for the least problematic one, but already telling something.

I can't help it if you are sensitive and have emotional problems

I am not and I don't have problems. I didn't say I needed healing. I just said I'm not surprised you get kicked. Very apparently you have trouble with avoiding such situation. Don't hope the world to change to be able to accomodate your way of putting things, that won't happen, you'll have to change your mind to get things going.

It's evidently too much for you to handle to file bugs in venues that implement your releases when those venues don't implement it right

Well... just yes?

I can't be held responsible for making sure that the whole world is using speech-dispatcher properly.

Thanking can't heal the abrupt ways of presenting things before.

Heal exactly what?

We're not going to get anywhere with you wearing your sensitive emotions on your sleeves, talking about "heal".

I come from a very non-soft, non-cushiony environment devoid of these little emotionally sensitive issues folks cook up in their own minds. We had to survive in a war zone.

Now, all of a sudden folks online can't handle direct communication.

“I'm just conveying to you something is a foot”

What?

You are getting emotionally disturbed by that language?

Weak. Weak-minded. Wouldn't last 2 minutes in the place I grew up in. Nobody to go whine to about your little feelings getting hurt.

That was not my intention. However, based on your comments I can see that folks really are just sensitive and weak-minded and come from very coddled upbringings.

I began writing code as a way to get awa from politics, as that is what I was doing, in the field. A release as it were. No petty little sniveling folks, no serious negotiations or all hell breaks lose. Turns out there is no realm without politics. Yet in code developers have no clue about direct communication; they think they are high and mighty and deserve "respect". Well, I learned long ago "respect" is just an emotion based on somebody else's mood at that moment. Enmeshment. I have not been "disrespectful". I'm just giving it to you plain, without rancor.

Folks on these boards write all of the time "You think you're smart"; "You have an ego", etc. Well, when you litigate up to through the federal courts to the U.S. Supreme Court, twice, by yourself; write your own patent claims; have 5 trades under your belt; perform primary source research for attorneys; and write code every day, you don't have time for somebody's little emotional problems with how you talk. It's insignificant - and really based on their insecurities, or living in a coddled worls without having to stand tall in the midst of serious agressors, and fighting the state at the same time.

Only the untalentaed can afford to be humble. -Sylvia Plath

And you are still wondering why you get kicked?

You are getting emotionally disturbed by that language?

Who said I was emotionally disturbed?

What I mean, and you don't seem to want to understand, is that this was already a sign that discussion wasn't going to go smoothly. And it did get worse and worse throughout.

I can understand that people have background. But you have to understand that the rest of the world will have trouble interacting with you if you don't manage to put that aside.

Now, blarb as much as you want here, I won't be there to answer you about that topic.

And you are still wondering why you get kicked?

No.

I already said why. Individuals and organizations are weak and weak-minded.

I publicly documented the official reason those organizations provided, if any in my banned repository.

I can understand that people have background. But you have to understand that the rest of the world will have trouble interacting with you if you don't manage to put that aside.

I really don't know what you are talking about.

I haven't called you out of your user name. You are dealing with your emotional issues. That's your issue, not mines.

I just notified you speech-dispatcher is not working as intended re speechSyntehsis.pause() and speechSynthesis.resume(). I didn't ask you for a lecture about how I communicate.