[Tts-project] Speech-dispatcher: do any modules/backends support playing sound-icons ?
Luke Yelavich
luke.yelavich at canonical.com
Thu May 21 22:41:49 UTC 2015
On Fri, May 22, 2015 at 06:53:45AM AEST, Sander Eikelenboom wrote:
> Hello Sander,
>
> Thursday, May 21, 2015, 10:40:24 PM, you wrote:
>
> > Sunday, May 17, 2015, 2:18:38 PM, you wrote:
>
> >> Sunday, May 17, 2015, 10:30:31 AM, you wrote:
>
> >>> Sunday, May 17, 2015, 12:55:55 AM, you wrote:
>
> >>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>> Hash: SHA512
>
> >>>> hi
> >>>> As far as I know, espeak does. The issue is that sond icons are not
> >>>> usually included in speech-dispatcher packages by default, and they're
> >>>> not usually in linux distribution repositories. I remember actually
> >>>> grabbing the sound icons package once, but never got it working. This
> >>>> is one area that might need help from distro maintainers. I can
> >>>> probably get someone to include a sound icons package in arch if it
> >>>> will get at least a little use
> >>>> Thanks
> >>>> Kendell clark
>
> >>> Added the Debian sound-icons package maintainer and the "Debian Accessibility
> >>> Team" mailinglist to the CC.
>
> >>> I'm using Debian Jessie, it has an seperate package for the sound-icons them
> >>> selves and i have it installed:
> >>> $ dpkg -l | grep speech
> >>> ii espeak 1.48.04+dfsg-1 amd64 Multi-lingual software speech synthesizer
> >>> ii espeak-data:amd64 1.48.04+dfsg-1 amd64 Multi-lingual software speech synthesizer: speech data files
> >>> ii festival 1:2.1~release-8 amd64 General multi-lingual speech synthesis system
> >>> ii festival-dev 1:2.1~release-8 amd64 Development kit for the Festival speech synthesis system
> >>> ii festlex-poslex 1.4.0-5 all Part of speech lexicons and ngram from English
> >>> ii libespeak-dev:amd64 1.48.04+dfsg-1 amd64 Multi-lingual software speech synthesizer: development files
> >>> ii libespeak1:amd64 1.48.04+dfsg-1 amd64 Multi-lingual software speech synthesizer: shared library
> >>> ii libflite1:amd64 1.4-release-12 amd64 Small run-time speech synthesis engine - shared libraries
> >>> ii libgsm1:amd64 1.0.13-4 amd64 Shared libraries for GSM speech compressor
> >>> ii libopencore-amrnb0:amd64 0.1.3-2.1 amd64 Adaptive Multi Rate speech codec - shared library
> >>> ii libopencore-amrwb0:amd64 0.1.3-2.1 amd64 Adaptive Multi-Rate - Wideband speech codec - shared library
> >>> ii libsonic0:amd64 0.1.17-1.1 amd64 Simple library to speed up or slow down speech
> >>> ii libspeechd-dev 0.8-7 amd64 Speech Dispatcher: Development libraries and header files
> >>> ii libspeechd2:amd64 0.8-7 amd64 Speech Dispatcher: Shared libraries
> >>> ii mbrola 3.01h+1-2 amd64 Multilingual software speech synthesizer
> >>> ii python3-speechd 0.8-7 all Python interface to Speech Dispatcher
> >>> ii sound-icons 0.1-3 all Sounds for speech enabled applications
> >>> ii speech-dispatcher 0.8-7 amd64 Common interface to speech synthesizers
> >>> ii speech-dispatcher-audio-plugins:amd64 0.8-7 amd64 Speech Dispatcher: Audio output plugins
> >>> ii speech-dispatcher-festival 0.8-7 amd64 Festival support for Speech Dispatcher
> >>> ii speech-tools 1:2.1~release-8 amd64 Edinburgh Speech Tools - user binaries
>
> >>> Double checked and they are in: /usr/share/sounds/sound-icons/ which corresponds
> >>> with the path in speech-dispatchers espeak.conf file.
>
> >>> Is there by your knowledge an option on package build-time that could be
> >>> involved (and is perhaps not enabled) ?
>
> >>> I will try to switch on some more debugging again, see if it comes up with
> >>> something (can't remember it did last time i tried).
>
> >>> Thanks for your time !
>
> >>> --
> >>> Sander
>
> >> Here is my simple python test script:
> >> #!/usr/bin/env python3
>
> >> import speechd
>
> >> ssipclient = speechd.SSIPClient('sound-icon-test', socket_path='/run/user/1000/speech-dispatcher/speechd.sock')
> >> ssipclient.sound_icon('start')
> >> ssipclient.sound_icon('trumpet-12')
> >> ssipclient.sound_icon('trumpet-12.wav')
> >> ssipclient.close()
>
>
> >> But instead of playing the sound of the sound-icon, it reads the name.
>
> >> I have set debug to 5 and attached the speech-dispatcher logs from running this
> >> script. With my untrained eye i don't see anything obvious though.
>
> >> --
> >> Sander
>
>
> >>>> Sander Eikelenboom wrote:
> >>>>> Hi All,
> >>>>>
> >>>>> I'm trying out speech-dispatcher and the python module for a
> >>>>> project. Speech works great, but i'm struggling to to get the
> >>>>> "sound-icons" to work. The documentation is rather sparse :-(
> >>>>>
> >>>>> from /etc/speech-dispatcher/modules/espeak.conf it seems that
> >>>>> espeak doesn't support sound-icons, which is a but cryptic since
> >>>>> after that it shows configuration options for sound-icons ?: # --
> >>>>> SOUND ICONS -- # Espeak does not currently support playing sound
> >>>>> icons # (audio files that are played by name when an application
> >>>>> requests # a sound icon). If you have installed the free(b)soft
> >>>>> sound-icons # package, this is the directory where will they be
> >>>>> found. If not # blank, the espeak Output Module will play them if
> >>>>> it finds a # file whose name matches the sound icon name. If
> >>>>> blank, or no # matching file is found, the name of the sound icon
> >>>>> will be spoken.
> >>>>>
> >>>>> EspeakSoundIconFolder "/usr/share/sounds/sound-icons/"
> >>>>>
> >>>>> # Volume at which sound icons are played. EspeakSoundIconVolume 0
> >>>>>
> >>>>>
> >>>>> I also tried festival, but still to no avail ..
> >>>>>
> >>>>> So the first question is .. are there any modules/backends that do
> >>>>> support playing sound-icons ?
> >>>>>
> >>>>> Hope you can give me a pointer in the right direction !
> >>>>>
> >>>>> -- Sander
> >>>>>
>
>
> > Ok i finally determined what the problem is:
>
> > espeak relies on speech-dispatcher to return 0 for the uri_callback if it has to
> > play the sound, if it gets 1 back, it will speak the name of the sound-icon
> > instead.
>
> > But in speech-dispatcher src/modules/espeak.c:uri_callback() the return that
> > returns 0 is ifdeffed:
>
> > static int uri_callback(int type, const char *uri, const char *base)
> > {
> > int result = 1;
> > if (type == 1) {
> > /* Audio icon */
> > #if HAVE_SNDFILE
> > if (g_file_test(uri, G_FILE_TEST_EXISTS)) {
> > result = 0;
> > }
> > #endif
> > }
> > return result;
> > }
>
> > And Debians speech-dispatchers isn't compiled with libsndfiledev1, so it always
> > returns 1.
>
> > But since the code in the ifdef has no relation with libsndfiledev, is it even
> > needed in the first place ?
>
> > Both solutions make sound-icons work for me on Debian Jessie:
> > - recompiling with libsndfiledev installed
> > or
> > - removing the ifdef from uri_callback
>
> > But removing the ifdef as it seems pointless is looking like the best solution
> > to me.
>
> Hmm that seems to be incorrect, probably tested with a stale tree or something.
> When returning 0, it seems to be speech-dispatches that is going to play the
> sound instead of espeak, using the code in
> src/modules/module_utils.c:module_play_file()
>
> So the only solution seems to be for Debian to compile with libsndfiledev as
> build dependency.
Git master and the 0.8 branch has already got a patch in it that bumps libsndfile to a mandetory build depednecy, and the ifdefs are removed in that patch as well.
?So as of 0.8.3, libsndfile will be required, such that the sound icon experience is not impaired for users.
Luke
More information about the Tts-project
mailing list