forked from stream-monkey/aws-transcribe-to-vtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (33 loc) · 925 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict'
/**TODO
-Break into node index.js and node test functions so it doesn't load the player every time.
*/
const fs = require('fs')
const async = require('async');
const VttConvert = require('./lib/vttConvert')
const vttConvert = new VttConvert()
const express = require('express')
const app = express()
const prompt = require('prompt-sync')();
app.use(express.static('output'))
var path = prompt('What is the path to the json file from AWS? ');
fs.readFile(path, 'utf8', (err, file) => {
if (err) {
console.log(err);
return err
}
vttConvert.convertFile(file, (err, res) =>
{
if (err)
{
console.log(err);
return err
}
fs.writeFile('output/output.vtt', res, (err) => {
if (err) throw err;
console.log('The file has been saved!');
process.exit();
});
return res
})
})