Allow webserver to create files and request to var/www/tts

I want to implement a local TTS engine on my raspberry pi so I followed this link:

The problem is @ben_jones12 said that:

and

As far as I know, I can use apache to config the web server to do the thing @ben_jones12 said, but I failed. Does anyone has experience of doing such thing before?
Can you show me how to implement 2 things like @ben_jones12 mentioned above?

You need to ensure the folder /var/www/tts is owned by www-data. Then add the following apache2 conf file;

###############################
# Local access to HTTP wrappers for TTS service
###############################
<Location /tts>
    Options None
    Order deny,allow
    Deny from all
    Allow from localhost
    Allow from 192.168.10.0/255.255.255.0
</Location>

Do I need to change the IP address in this line ?

Allow from 192.168.10.0/255.255.255.0 

Yes - that needs to match your LAN

so here is the thing I going to do, can you verify them:

  1. sudo chown www-data: /var/www/tts
  2. add the following code to /etc/apache2/apache2.conf file: (But the IP address is my raspberry pi’ IP address)
###############################
# Local access to HTTP wrappers for TTS service
###############################
<Location /tts>
    Options None
    Order deny,allow
    Deny from all
    Allow from localhost
    Allow from 192.168.10.0/255.255.255.0
</Location>

It would be much better to implement this directly as a bundle, which simply accesses the tts engine through command line calls - this would be less of a hack.

@Kai How can I do that? As I read on openhab github respository there are 2 sections about using local TTS

@Kai Furthermore, many thread on this forum said that several TTS engine bundle are unstable or gone away, such as voicesrr or MaryTTS, GoogleTTS…Can you show me what should I do to have a stable and acceptable quality TTS system without so many hacks? Thanks very much

I tried espeak,festival and I found the voice was quite robotic (from below link):


http://elinux.org/RPi_Text_to_Speech_(Speech_Synthesis)


Easiest to look at other TTS services are implemented: https://github.com/openhab/openhab2-addons/tree/master/addons/voice/org.openhab.voice.voicerss

VoiceRSS actually gives quite decent results.

Is it still work with OH 1.8.3 ?
EDIT: Is there any items and sitemaps,rules sample configuration to use this TTS service?

I installled voicerss in my raspberry pi 3 and I successfully tested it by using tts command on terminal. But when I tried using say command in the rules file, I couldn’t hear anything

So I think it is possible to write script file or .sh file so that we can activate TTS engine (VoiceRSS in this case) from those files. But I don’t know how to write it (my coding ability is extremely limited). I dont know how to call those script files from rules file, either.

So anyone can show me some examples and tips?
Thanks sooo much!