Giter Club home page Giter Club logo

fn-text2speech's Introduction

Function for Text to Speech conversion

This function converts text to speech using the alpine 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 <context name>

Create an app

fn create app text2speech --annotation oracle.com/oci/subnetIds=<SUBNETS>

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)

fn-text2speech's People

Contributors

abhirockzz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.