Skip to content

Commit 689f4a0

Browse files
committed
updating documentation supported file type package.json to 1.0.1 release and play a round with changing number of words in srt line is 8 currently
1 parent 2f8919f commit 689f4a0

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

docs/_posts/2016-09-08-usage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ If first time using the tool go ahead and [setup the STT API system first]({{sit
2525

2626
<!-- if you using Gentle STT for offline transcription seee setup STT API for Gentle []()-->
2727

28+
29+
[For a list of supported media file type see ffmpeg(which is what has been used for the file conversion under the hood)](https://ffmpeg.org/general.html#Supported-File-Formats_002c-Codecs-or-Features)
30+
31+
2832
---
2933

3034
The transcription will take a round **5 minutes** to process regardless of the length of the media.

docs/public/demo/frontEnd/js/models/transcription.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ app.Transcription = Backbone.Model.extend({
9393
_.each(text, function(paragraphs){
9494

9595
_.each(paragraphs.paragraph, function(paragraph){
96-
97-
98-
if(paragraph.line.length > 8){
96+
//keep it to even number so that it can be split across two lines
97+
var numberOfWords = 16;
98+
//numberOfWords is over two lines, so to check if need to split we check if the words in one line are
99+
//above the number of words for one line.
100+
if(paragraph.line.length > (numberOfWords)){
99101
// console.log(JSON.stringify(paragraph))
100102
// console.log(JSON.stringify(paragraph.line.length))
101103
// console.log("---")
102-
var regroupLines = split(paragraph.line, 8)
104+
var regroupLines = split(paragraph.line, numberOfWords)
103105
// console.log(regroupLines)
104106
//make srt lines
105107
_.each(regroupLines, function(l){
@@ -113,8 +115,18 @@ app.Transcription = Backbone.Model.extend({
113115
_.each(l, function(w){
114116
// console.log("---");
115117
// console.log(JSON.stringify(w));
116-
newLine.text += w.text +" ";
118+
newLine.text += w.text.replace(/%HESITATION /g, "") +" ";
119+
// newLine.text = newLine.text.replace(/%HESITATION /g, "");
117120
})//words
121+
//split text line into two lines
122+
var wordsInOneLine = numberOfWords/2;
123+
var lineWordsAr = newLine.text.split(" ")
124+
var firstLine = lineWordsAr.slice(0,wordsInOneLine)
125+
var secondLine = lineWordsAr.slice(wordsInOneLine, numberOfWords)
126+
//replacing text with two lines
127+
newLine.text = firstLine.join(" ") + "\n"+secondLine.join(" ");
128+
newLine.text = newLine.text.replace(/%HESITATION /g, "");
129+
// end split text line into two lines
118130
newLinesAr.push(newLine)
119131
newLine={}
120132
})//lines in regrouped lines
@@ -127,8 +139,9 @@ app.Transcription = Backbone.Model.extend({
127139
newLine.text = ""
128140
_.each(paragraph.line, function(word){
129141
// console.log(word)
130-
newLine.text += word.text +" "
142+
newLine.text += word.text.replace(/%HESITATION /g, "") +" "
131143
})//line
144+
132145
newLinesAr.push(newLine)
133146
newLine={}
134147
}

frontEnd/index.html

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,11 @@
5454
* To make sure scripts are deployed int he right order when NWJS is packaged, a little bit of callbacl hell.
5555
*/
5656
loadJQueryExtScript("vendor/jquery.min.1.12.4.js",function(script){
57-
58-
//set jquery for bootstrap
59-
60-
// if (typeof require === "function") {
61-
// window.jQuery = window.$ = require("jquery");
62-
// }else{
63-
64-
// window.jQuery = window.$ = $;
65-
// }
66-
6757
loadExtScript("vendor/bootstrap-3.3.6-dist/js/bootstrap.js",function(){
68-
6958
loadExtScript("vendor/underscore-min.js",function(){
7059
loadExtScript("vendor/backbone-min.js",function(){
71-
72-
// loadExtScript("vendor/backbone.async.js",function(){
73-
74-
loadExtScript("js/sync.js",function(){
75-
76-
//app.js backbone files
60+
loadExtScript("js/sync.js",function(){
61+
//app.js backbone files
7762
loadExtScript("js/models/transcription.js",function(){
7863
loadExtScript("js/collections/transcriptions.js",function(){
7964
loadExtScript("js/views/transcription_index.js",function(){
@@ -97,7 +82,7 @@
9782

9883
// jesselynRadackTranscription.save();
9984
//end Demo
100-
})
85+
})
10186
})
10287
})
10388
})
@@ -467,7 +452,7 @@
467452

468453
<!-- Metadata info button -->
469454
<a class="btn btn-default btn-xs" role="button" data-toggle="collapse" href="#collapseMetadata" aria-expanded="false" aria-controls="collapseMetadata">
470-
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> Metadata
455+
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> Info
471456
</a>
472457
<!-- End metadata info button -->
473458

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "autoEdit2",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Text based video editing app",
55
"main": "frontEnd/index.html",
66
"chromium-args": "--mixed-context",

0 commit comments

Comments
 (0)