Code Monkey home page Code Monkey logo

voice-question-assistant-'s Introduction

Alexa MVP

This project contains a series of microservices, which when all are running - the main service (alexa.go) can be used. This main service takes in an audio file (.wav) of any question and return an audio file with the corrosponding answer.

Alpha Microservice

This microservice takes a JSON object that has a “text” property whose value is a question string, and returns a JSON object that has an “text” property whose value is an answer string.

Speech-to-Text Microservice

This microservice takes a JSON object that has a “speech” property whose value is a WAV sound encoded as a string using the Base64 scheme, and returns a JSON object that has a “text” property whose value is a text string.

Text-to-Speech Microservice

This microservice takes a JSON object that has a “text” property whose value is a text string, and returns a JSON object that has a “speech” property whose value is a WAV sound encoded as a string using the Base64 scheme.

Alexa Microservice

This microservice takes a JSON object that has a “speech” property whose value is a WAV sound encoded as a string using the Base64 scheme. This speech should be a question. The microservice returns a JSON object that has a “speech” property whose value is again a WAV sound encoded as a string using the Base64 scheme.

API Keys

Alpha API key

The Alpha microservice (alpha.go), uses the Short Answers API of the Wolfram Alpha computational knowledge engine. Signup is free, you will recieve an app id which you must place into the following file.

  /alpha.go
const{
    ...

    APPID = "Put your AppId here"
}

Speech-to-Text and Text-to-Speech API keys

The speech-to-text (stt.go) and text-to-speech (tts.go) microservices use the APIs from Microsoft Azure Cognitive Services. Free API keys for these services can be generated by following the free sign up here.

Where to put your key

The same key can be used for both services, but adjustments must be made to the following files:

  /tts.go
  /stt.go

Replace the quoted section with your API key in both files.

const{
    ...

    xxxKEY = "Put your api key here"
}

Running the Microservices

To run locally, each microservice needs to be run using localhost (3000, 3001, 3002, 3003). To activate the microservces, open up four seperate terminal windows and go to the file directory for each microservice and input the following command:

  go run microservice.go

For the alexa.go microservice to work, the other microservices (alpha.go, stt.go, tts.go) must be running.

To send requests to each microservice, edit the corrosponding shell scrips with your request. Note: all and then run the following commands:

Alpha Service:

  ./alphatest.sh

Speech-to-Text Service:

  ./stttest.sh

Text-to-Speech Service:

  ./ttstest.sh

Alexa Service:

  ./alexatest.sh

Lessons Learned

The purpose of this project was to get to grips with the basics of GoLang, while understanding and implimenting some basic microservices. This project has demonstrated the simplicity and power of Go, especially within http.

License

MIT

voice-question-assistant-'s People

Contributors

richwardle avatar

Watchers

 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.