From b7813b432b126ac7a623dd5810235ab198d286a3 Mon Sep 17 00:00:00 2001 From: pietrop Date: Mon, 9 Apr 2018 09:03:45 +0100 Subject: [PATCH] adding travis adding travis.yml support --- .travis.yml | 39 ++++ .../transcriber/speechmatics/notes.md | 203 ++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 .travis.yml create mode 100644 lib/interactive_transcription_generator/transcriber/speechmatics/notes.md diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bf3e448 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,39 @@ +# https://github.com/OpenNewsLabs/autoEdit_2/issues/36 + +language: node_js +node_js: + - "7" + +os: linux +dist: trusty +sudo: required + +cache: + directories: + - node_modules + - $HOME/.electron + - $HOME/.npm + - $HOME/.nvm + +addons: + apt: + packages: + - libgnome-keyring-dev + - icnsutils + +install: + - node --version + - npm --version + - npm install + +script: +# - npm run test + - npm run build + - find . | grep AppImage + - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + - bash upload.sh ./dist/autoEdit2-*-x86_64.AppImage + +branches: + except: + - # Do not build tags that we create when we upload to GitHub Releases + - /^(?i:continuous)/ \ No newline at end of file diff --git a/lib/interactive_transcription_generator/transcriber/speechmatics/notes.md b/lib/interactive_transcription_generator/transcriber/speechmatics/notes.md new file mode 100644 index 0000000..1367560 --- /dev/null +++ b/lib/interactive_transcription_generator/transcriber/speechmatics/notes.md @@ -0,0 +1,203 @@ + + +- [API details](https://app.speechmatics.com/api-details) +- [node module](https://www.npmjs.com/package/speechmatics) +- [List of languages and language codes](https://www.speechmatics.com/language-support/) + +## node module tests + +```js +"use strict"; +const fs = require("fs"); + +const Speechmatics = require('speechmatics'); +const sm = new Speechmatics(userID, apiToken); + +var jobId = "7420708"; + +var opts = {}; + +var existingReadStream = fs.createReadStream("./zero.wav"); +``` + +```js +sm.createJob({audioStream: existingReadStream}, function(error, res){ + console.log(JSON.stringify(res)); + //{"balance":360,"check_wait":null,"cost":0,"id":7420708} +}); +``` + +See below ," Speechmatics transcription data structure " for more details on this. + +```json +{ + "job": { + "lang": "en-US", + "user_id": 11173, + "name": "zero.wav", + "duration": 0, + "created_at": "Wed Apr 4 21:49:48 2018", + "id": 7420708 + }, + "speakers": [], + "words": [], + "format": "1.0" +} +``` + +```js +sm.getTranscript(jobId, opts,callback); +``` +```json + { + "job": { + "lang": "en-US", + "user_id": 11173, + "name": "zero.wav", + "duration": 0, + "created_at": "Wed Apr 4 21:49:48 2018", + "id": 7420708 + }, + "speakers": [], + "words": [], + "format": "1.0" +} +``` + +```js +sm.getJob(jobId, opts, callback); +``` +```json +{ + "check_wait": null, + "created_at": "Wed, 04 Apr 2018 21:49:48 GMT", + "duration": 0, + "id": 7420708, + "job_status": "done", + "job_type": "transcription", + "lang": "en-US", + "meta": null, + "name": "zero.wav", + "next_check": 0, + "notification": "email", + "transcription": "zero.json", + "url": "/v1.0/user/11173/jobs/7420708/audio", + "user_id": 11173 +} +``` + +>'check_wait': how long (in seconds) Speechmatics advises you should wait before next checking on the status of this job (null if job is finished). + +```js +sm.getStatus(opts, callback); +``` +```json +{ + "Average_Turnaround_Mins": 2, + "Known_Issues": false, + "Queue_Length_Mins": 0, + "Status": "Good", + "Time_UTC": "Wed, 04 Apr 2018 22:00:04 GMT" +} +``` + +``` +function callback(error, res){ + console.log(JSON.stringify(res, null, 2)); +} +``` + + +---- + +## Speechmatics transcription data structure + +```js +sm.getTranscript(jobId, opts,callback); +``` + +returns + +```json +{ + "job": { + "lang": "ur", + "user_id": 11173, + "name": "norman_door_trimmed2.mp4.temp.wav", + "duration": 4, + "created_at": "Wed Apr 4 21:45:44 2018", + "id": 7420669 + }, + "speakers": [ + { + "duration": "4.34", + "confidence": null, + "name": "M1", + "time": "0.15" + } + ], + "words": [ + { + "duration": "0.32", + "confidence": "0.480", + "name": "کچھ", + "time": "0.15" + }, + { + "duration": "0.33", + "confidence": "0.480", + "name": "ان", + "time": "0.86" + }, + { + "duration": "0.55", + "confidence": "0.480", + "name": "سے", + "time": "1.25" + }, + { + "duration": "0.33", + "confidence": "1.000", + "name": "جو", + "time": "1.80" + }, + { + "duration": "0.29", + "confidence": "0.910", + "name": "بنو", + "time": "2.61" + }, + { + "duration": "0.44", + "confidence": "0.510", + "name": "منڈوا", + "time": "2.90" + }, + { + "duration": "0.18", + "confidence": "1.000", + "name": "اس", + "time": "3.36" + }, + { + "duration": "0.41", + "confidence": "0.930", + "name": "وفد", + "time": "3.55" + }, + { + "duration": "0.40", + "confidence": "0.350", + "name": "ڈزائن", + "time": "4.09" + }, + { + "duration": "0.00", + "confidence": "1.000", + "name": ".", + "time": "4.49" + } + ], + "format": "1.0" +} +``` \ No newline at end of file