[arm-allstar] tts help

David McGough kb4fxc at inttek.net
Sun Jul 24 12:22:29 EST 2016


Doug,

I think the tts_audio2.sh code still has some issues. Here is a example 
code snippet that seems to work well....It needs to be integrated into the 
tts_audio script:


#--------------------------------------------------------------------------------
#!/bin/bash

export TTS_KEY='put your key here!'
export TTS_R='0'
export TTS_HL='en-us'
export TTS_F='ulaw_8khz_mono'
export TTS_C='WAV'
export FILE="This is a the time to test the voice R S S sotware A P I for functionality with long lines and lots of gibberish to chew on...Now the weather is stormy with a chance of hurricanes and tornados and other nasty conditions for the raleigh, fayettville, wilmington, clinton, burgaw, and morehead city areas. If you are out boating in Kerr lake, make sure to put your life preserver on to keep you safe after flying away in a water spout."


curl -s -G "http://api.voicerss.org/?key=${TTS_KEY}&r=${TTS_R}&hl=${TTS_HL}&f=${TTS_F}&c=${TTS_C}" --data-urlencode "src=${FILE}" > /tmp/audio.wav
RES=$?

sox /tmp/audio.wav /tmp/audio.ul
asterisk -rx "rpt localplay 1998 /tmp/audio"
#--------------------------------------------------------------------------------

73, David KB4FXC


On Sun, 24 Jul 2016, Doug Crompton via arm-allstar wrote:

> Greg,
> 
>  Please try the attached script. I hacked it up a bit. You can rename the current file to tts_audio.sh.old and then put this in as tts_audio.sh and make it executable.
> 
> I don't think voicerss needs small file sizes like google did and that code was still in there.
> 73 Doug
> WA3DSP
> http://www.crompton.com/hamradio
> 
> 
> To: kb1ncj at gmail.com
> Date: Sun, 24 Jul 2016 11:37:36 -0400
> Subject: Re: [arm-allstar] tts help
> From: arm-allstar at hamvoip.org
> CC: doug at crompton.com; arm-allstar at hamvoip.org
> 
> 


First of all the SD card size has nothing to do with it. It looks like you are might be exceeding the /tmp filesize. This might be OK to a degree but the ram is 1 GB and other things including the system reside there.
> 
> When you get into this problem do an ls -ls /tmp  or the same on a directory in /tmp. You could also use du on /tmp.
> 
> Something is not getting cleaned up or the filesize that is being created exceeds the available size. I suspect when Chris wrote the tts script it was not intended for extremely large files but rather shorter conversions.  While it could be written to the SD card instead of /tmp in the long run that would not be a good idea. You could change all references to /tmp/... in the script to /root/...  and see what happens. I would not leave it that way though.
> 
> 73 Doug
> WA3DSP
> http://www.crompton.com/hamradio
> 
> 
> Subject: Re: [arm-allstar] tts help
> To: doug at crompton.com
> From: kb1ncj at gmail.com
> Date: Sun, 24 Jul 2016 11:14:18 -0400
> 
> 
  
    
  
  
    This is tough.. looking through the
      script. I tested some urls manually with content duplicating the
      curl option in the script. It works to download an mp3. I am
      confused with the "\"'s in the url in the script. The webpage
      seems to want those to go away.. I download the file if I remove
      most of them and if I don't it sees \ as part of the api key and
      rejects. I assume those are stripped by curl? I wish this was
      broken or fixed but with it working "sometimes" I am stumped..
> 
      Also it was not the issue, the tmp file.. I rebooted and thought
      it was fixed but the .ul was not generated.. The tts_audio.sh with
      a text file still outputs the error I reported. 
> 
      
> 
      root at bbb-allstar ~]# df -h
> 
      Filesystem      Size  Used Avail Use% Mounted on
> 
      /dev/root       7.2G  1.4G  5.5G  20% /
> 
      devtmpfs        236M     0  236M   0% /dev
> 
      tmpfs           248M     0  248M   0% /dev/shm
> 
      tmpfs           248M  4.3M  244M   2% /run
> 
      tmpfs           248M     0  248M   0% /sys/fs/cgroup
> 
      tmpfs           248M  404K  248M   1% /tmp
> 
      tmpfs            50M  252K   50M   1% /var/log
> 
      tmpfs            50M     0   50M   0% /run/user/0
> 
      
> 
      
> 
      
> 
      On 07/24/2016 10:28 AM, Doug Crompton wrote:
> 
    
    
      
      Greg,
> 
          
> 
           I cannot imagine why that would be happening other than
          running out of space. The /tmp directory is a tmpfile system
          and stored in ramdisk. Look at it more closely and see if
          something like that is happening. Are there any stale files in
          there growing in size? Either it is that or you have bad ram.
          I have never seen or had either reported.
        
> 
        73 Doug
> 
          WA3DSP
> 
          http://www.crompton.com/hamradio
> 
        
> 
        
> 
        > Subject: Re: [arm-allstar] tts help
> 
          > To: doug at crompton.com
> 
          > CC: arm-allstar at hamvoip.org
> 
          > From: kb1ncj at gmail.com
> 
          > Date: Sun, 24 Jul 2016 10:19:04 -0400
> 
          > 
> 
          > The error appears to be an issue with writing to the /tmp
          directory 
> 
          > after a while. I switched to paid account on voicerss.org
          and nothing 
> 
          > changed. A reboot fixes. I wonder if there is a way to
          fix besides reboots?
> 
          > 
> 
          > Thanks
> 
          > Greg
> 
          > 
> 
        
      
    
    
> 
    
>  		 	   		  

> _______________________________________________

arm-allstar mailing list
arm-allstar at hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar

Visit the BBB and RPi2 web page - http://hamvoip.org 		 	   		  



More information about the arm-allstar mailing list