Skip to content

Instantly share code, notes, and snippets.

View ShahriarDhruvo's full-sized avatar
🔬
Training & Exploring

Shahriar_Dhruvo ShahriarDhruvo

🔬
Training & Exploring
View GitHub Profile
@javatask
javatask / index.js
Created October 24, 2019 13:17
Convert Google speech to text JSON into SRT
const text = require("./text.json");
function toHHMMSS(seconds) {
var sec_num = parseInt(seconds, 10); // don't forget the second param
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - hours * 3600) / 60);
var seconds = sec_num - hours * 3600 - minutes * 60;
if (hours < 10) {
hours = "0" + hours;