API calls to
https://deep-talk.azurewebsites.net/api/v1/getVoice
POST requests accepts 16kHZ mono 16bits WAV audio files in multipart form data,the field name should be 'audio'
sample responses:
No audio file:
const ds = require('deepspeech-tflite'); | |
const fs = require('fs'); | |
let model = new ds.Model('./pathTodeepspeech.tflite'); | |
model.enableExternalScorer('./pathTodeepspeech.scorer'); | |
const deepSpeech = async (req, res, next) => { | |
//if no file was received | |
if (!req.file) { | |
res.send({ message: 'No audio file has been received' }); | |
return |
API calls to
https://deep-talk.azurewebsites.net/api/v1/getVoice
POST requests accepts 16kHZ mono 16bits WAV audio files in multipart form data,the field name should be 'audio'
sample responses:
No audio file:
import React, {useRef} from 'react'; | |
const AudioGraph = ({dataArray})=>{ | |
const canvasRef = useRef(); | |
//this function updates the canvas reference with the current sound frequencies | |
const draw = () => { | |
//canvasRef is a ref created with useRef hook | |
canvasRef.current.getContext('2d').fillStyle = 'rgb(255, 255, 255,0.5)'; | |
canvasRef.current.getContext('2d').clearRect(0, 0, window.innerWidth, 100); |
//new audiocontext | |
let audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
//analyzer for the audio context | |
let analyser =audioCtx.createAnalyser(); | |
//request microphone access | |
navigator.mediaDevices.getUserMedia({ audio: true, video: false }) | |
.then(async (stream) => { | |
//analize sound waves | |
//stream source |
import React from 'react'; | |
import ActivateOnClick from '../PathToActivateOnClick; | |
//CodeGist props: | |
//url:string //<-- represents the Github gist url | |
//CodeGist accept a children component as a prop, so you can wrap a label or any component you want to render before | |
// the Gist | |
const Example=()=>{ | |
return( | |
<React.Fragment> |
import React from 'react'; | |
import CodeGist from '../PathToCodeGist; | |
//CodeGist props: | |
//url:string //<-- represents the Github gist url | |
//CodeGist accept a children component as a prop, so you can wrap a label or any component you want to render before | |
// the Gist | |
const Example=()=>{ | |
return( | |
<React.Fragment> |
//Im a comment | |
//me too | |
const imAFunctionExample=()=>{ | |
console.log("Hello World"); | |
} | |
imAFunctionExample(); | |
import React from 'react'; | |
import ChattyForm from '../PathToChattyForm'; | |
//import icons | |
import FingerPrintIcon from '../PathToFingerPrintIcon' | |
import AlternateEmailIcon from '../PathToAlternateEmailIcon' | |
import CommentIcon from '../PathToCommentIcon' | |
//ChattyForm props: | |
//inputs: Array[{},{},{},...,{},{},[string],[string]] |