Tag:pythonphp
Article From:https://segmentfault.com/q/1010000012139424
Question:

Now there is a python program that can be pronounced in Cantonese.
Use Linux to invoke $sh zhspeak -zhy to pronounce what you want to say.
This is a combination of web website pronunciation, how to achieve it? Website call interface pronunciation is not to return to a MP3 file?

There is also a call to the python program that can also pronounce $Python zhspeak.py -zh “the voice to speak”.

The following is zhspeak

!/bin/sh

BIN_DIR=dirname "$0"
PY_MAIN=basename "$0"
case python3 --version 2>&1 | awk '{print $NF}' in
3.*)

exec python3 "$BIN_DIR/pyld.py" $PY_MAIN "$@"
;;

*)

exec python $0.py "$@"
;;

esac

Answer 0:

Method 1:

  1. Browser input text
  2. The server calls the python program
  3. pythonThe program writes the voice to the file
  4. The server returns a URL, which is internally directed to the URL file.
  5. The browser requests the URL to get the file
  6. Browser playback

Method two:

  1. Browser input text
  2. The server calls the python program
  3. pythonThe program writes the voice to the file
  4. The server returns the file to the browser in the form of flow.
  5. Browser playback

Leave a Reply

Your email address will not be published. Required fields are marked *