https://github.com/abhirockzz/fn-text2speech
Go function for text to speech conversion
https://github.com/abhirockzz/fn-text2speech
faas go oracle-functions orafunc-la serverless texttospeech
Last synced: 4 months ago
JSON representation
Go function for text to speech conversion
- Host: GitHub
- URL: https://github.com/abhirockzz/fn-text2speech
- Owner: abhirockzz
- Created: 2019-01-23T12:10:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T10:32:39.000Z (over 6 years ago)
- Last Synced: 2024-12-21T03:14:07.631Z (6 months ago)
- Topics: faas, go, oracle-functions, orafunc-la, serverless, texttospeech
- Language: Go
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Function for Text to Speech conversion
This function converts text to speech using the [alpine `flite`](https://pkgs.alpinelinux.org/package/v3.8/main/x86_64/flite) package.
It is installed in the runtime image using a custom Dockerfile which is only slightly different compared to the default one i.e. one line has been added to the runtime stage of the Docker build - `RUN apk add --no-cache flite`. This installs the `flite` package into the Docker image itself
The Go function
- uses `os.Command` to invoke the `flite` binary
- which converts the text into speech and saves it into `/tmp/output.wav` (this is deleted before the function exits)
- the file is then read and the raw bytes are simply returned to the caller## Pre-requisites
- Start by cloning this repository
- Configure your functions development environment
- Get latest Fn CLI - `curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh`
- Switch to right context using `fn use context `## Create an app
`fn create app text2speech --annotation oracle.com/oci/subnetIds=`
## Deploy to Oracle Functions
`fn -v deploy --app text2speech`
## Invoke (and listen..)
`echo -n 'Hope you enjoyed this text to speech example using Oracle Functions' | fn invoke text2speech talk > op.wav && afplay op.wav`
`echo -n 'That was dope!' | fn invoke text2speech talk > op.wav && afplay op.wav`
^^ (these work seamlessly on Mac)