Regarding Text To Speech Conversion

Home » Asterisk Users » Regarding Text To Speech Conversion
Asterisk Users 5 Comments

The Error Which I face I have attached. I need a clarification of Why I face this error and how to overcome this. Anybody know Please help……

5 thoughts on - Regarding Text To Speech Conversion

  • That’s a very common error and what it means is, the AGI script
    “/var/lib/asterisk/agi-bin/googletts.agi” either has an incorrect #! line, or needs chmod +x run on it.

    What do you get if you run
    # ls -l /var/lib/asterisk/agi-bin/googletts.agi and
    # head -n1 /var/lib/asterisk/agi-bin/googletts.agi respectively?

  • Please do not attach pictures. Please cut and past text.

    Another possibility if Windows boxes have been involved in downloading/extracting/copying the script — incorrect line endings.

    What does:

    od -c /var/lib/asterisk/agi-bin/googletts.agi | head –lines=2

    look like. Any ‘\r \n’ (Windows line ending) where ‘\n’ (Unix line ending)
    should be?

  • Thank You .

    But now i get solved with that error since I had some mistakes in installing googletts.agi

    Now when calling from my softphone i have written dialplan with an AGI
    script to convert from text to speech.

    It get executed without error but there is no sound getting played.

    My output,

    == Using SIP RTP CoS mark 5
    — Executing [1310@Client-dial-Menu:1] AGI(“SIP/1320-00000188”,
    “googletts.agi,”Say something in English, when done press the pound key.”,en”) in new stack
    — Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi
    AGI Tx >> agi_request: googletts.agi
    AGI Tx >> agi_channel: SIP/1320-00000188
    AGI Tx >> agi_language: en
    AGI Tx >> agi_type: SIP
    AGI Tx >> agi_uniqueid: 1425971947.392
    AGI Tx >> agi_version: 11.13.1
    AGI Tx >> agi_callerid: 1320
    AGI Tx >> agi_calleridname: Janani
    AGI Tx >> agi_callingpres: 0
    AGI Tx >> agi_callingani2: 0
    AGI Tx >> agi_callington: 0
    AGI Tx >> agi_callingtns: 0
    AGI Tx >> agi_dnid: unknown
    AGI Tx >> agi_rdnis: unknown
    AGI Tx >> agi_context: Client-dial-Menu
    AGI Tx >> agi_extension: 1310
    AGI Tx >> agi_priority: 1
    AGI Tx >> agi_enhanced: 0.0
    AGI Tx >> agi_accountcode:
    AGI Tx >> agi_threadid: 139811462272768
    AGI Tx >> agi_arg_1: Say something in English, when done press the pound key.
    AGI Tx >> agi_arg_2: en
    AGI Tx >>
    AGI Rx < < CHANNEL STATUS AGI Tx >> 200 result=6
    AGI Rx < < GET FULL VARIABLE ${CHANNEL(audionativeformat)} AGI Tx >> 200 result=1 ((gsm))
    AGI Script googletts.agi completed, returning 0
    — Executing [1310@Client-dial-Menu:2] Hangup(“SIP/1320-00000188”, “”)
    in new stack
    == Spawn extension (Client-dial-Menu, 1310, 2) exited non-zero on
    ‘SIP/1320-00000188’

    How could I solve this error??

    Thanks in Advance……

  • [stuff deleted]

    Plain old-fashioned hacking!

    First, try running the AGI script manually. Do a trace on it, so you can see how parameters get passed to the script; then middle-click-paste the data straight into the terminal. Make sure it really does what you’re expecting it to do. If your asterisk runs as a non-privileged user, make sure that it works even when the script is invoked as that user — if not, check and double-check file and device permissions.

    In the worst case, you will have to modify your AGI script by inserting statements at strategic points to write to syslog, or a file somewhere under
    /tmp/ so you can get an idea what is happening.

  • The CLI script has come in handy for me in the past. If this doesn’t work, the AGI script will likely not work.

    If run from a remote server, dump the TTS to a wav file:
    googletts-cli.pl -o hello.wav -l en -t “Hello world”