Skip to content

Instantly share code, notes, and snippets.

@craigeley
Created January 8, 2020 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigeley/88b97ad5b8ed1221e3ed381e726520e7 to your computer and use it in GitHub Desktop.
Save craigeley/88b97ad5b8ed1221e3ed381e726520e7 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/node
var sub = require('subtitle');
var fs = require('fs');
var WaveFile = require('wavefile').WaveFile;
// Load a wav file as a WaveFile object
let wav = new WaveFile('');
// Read from SRT file to get start, end, and region names
fs.readFile('/path/to/file.txt', 'utf8', function(err, data) {
if (err) throw err;
const words = sub.parse(data);
console.log(words);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment