A gentle STT module to connect to localhost version of gentle to be able to do offline transcriptions. For when the internet is too slow to use IBM, or when the material is too sensitive to be shared.
converts this curl comand in a node post request
curl -F "audio=@norman_door_trimmed2.mp4.wav" "http://localhost:8765/transcriptions?async=false"
in Curl -F
is a multipart form, from curl help.
-F, --form CONTENT Specify HTTP multipart POST data (H)
--form-string STRING Specify HTTP multipart POST data (H)
--ftp-account DATA Account data string (F)
--ftp-alternative-to-user COMMAND String to replace "USER [name]" (F)
--ftp-create-dirs Create the remote dirs if not present (F)
--ftp-method [MULTICWD/NOCWD/SINGLECWD] Control CWD usage (F)
--ftp-pasv Use PASV/EPSV instead of PORT (F)
parse_gentle_stt
is a module that converts gentle json to an array of words.
[
{
"id": 0,
"text": "good",
"startTime": 0.1,
"endTime": 0.29
},
...
]
For an example of gentle json to see what it look like before parsing check out /example/allign.json
-
Download Gentle version 0.9.1 about
104mb
-
start the Gentle app
-
click
Enable full transcription
, this will dowload the language model comonent to be able to work offline.
-
restart the app
-
the Gentle server is now up and running.
Future times, you just need to launch gentle anche check local host is working
var transcribe = require("./index.js")
//takes in fiel as absolute path, use node module `path` if you need to figure out out.
var demo_audio ="#yourFile.wav";
transcribe(demo_audio, function(resp){
console.log(JSON.stringify(resp, null, '\t'))
// console.log(resp)
})
add usefull error message if server(gentle) is offline
response if server is offline is
{ [Error: connect ECONNREFUSED 127.0.0.1:8765]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 8765 }
Initially developed at Hacks/Hackers Buenos Aires Media Party 2016