Skip to content

Commit

Permalink
updating documentation supported file type package.json to 1.0.1 rele…
Browse files Browse the repository at this point in the history
…ase and play a round with changing number of words in srt line is 8 currently
  • Loading branch information
pietrop committed Sep 28, 2016
1 parent 2f8919f commit 689f4a0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
4 changes: 4 additions & 0 deletions docs/_posts/2016-09-08-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ If first time using the tool go ahead and [setup the STT API system first]({{sit

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


[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)


---

The transcription will take a round **5 minutes** to process regardless of the length of the media.
Expand Down
25 changes: 19 additions & 6 deletions docs/public/demo/frontEnd/js/models/transcription.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ app.Transcription = Backbone.Model.extend({
_.each(text, function(paragraphs){

_.each(paragraphs.paragraph, function(paragraph){


if(paragraph.line.length > 8){
//keep it to even number so that it can be split across two lines
var numberOfWords = 16;
//numberOfWords is over two lines, so to check if need to split we check if the words in one line are
//above the number of words for one line.
if(paragraph.line.length > (numberOfWords)){
// console.log(JSON.stringify(paragraph))
// console.log(JSON.stringify(paragraph.line.length))
// console.log("---")
var regroupLines = split(paragraph.line, 8)
var regroupLines = split(paragraph.line, numberOfWords)
// console.log(regroupLines)
//make srt lines
_.each(regroupLines, function(l){
Expand All @@ -113,8 +115,18 @@ app.Transcription = Backbone.Model.extend({
_.each(l, function(w){
// console.log("---");
// console.log(JSON.stringify(w));
newLine.text += w.text +" ";
newLine.text += w.text.replace(/%HESITATION /g, "") +" ";
// newLine.text = newLine.text.replace(/%HESITATION /g, "");
})//words
//split text line into two lines
var wordsInOneLine = numberOfWords/2;
var lineWordsAr = newLine.text.split(" ")
var firstLine = lineWordsAr.slice(0,wordsInOneLine)
var secondLine = lineWordsAr.slice(wordsInOneLine, numberOfWords)
//replacing text with two lines
newLine.text = firstLine.join(" ") + "\n"+secondLine.join(" ");
newLine.text = newLine.text.replace(/%HESITATION /g, "");
// end split text line into two lines
newLinesAr.push(newLine)
newLine={}
})//lines in regrouped lines
Expand All @@ -127,8 +139,9 @@ app.Transcription = Backbone.Model.extend({
newLine.text = ""
_.each(paragraph.line, function(word){
// console.log(word)
newLine.text += word.text +" "
newLine.text += word.text.replace(/%HESITATION /g, "") +" "
})//line

newLinesAr.push(newLine)
newLine={}
}
Expand Down
23 changes: 4 additions & 19 deletions frontEnd/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,11 @@
* To make sure scripts are deployed int he right order when NWJS is packaged, a little bit of callbacl hell.
*/
loadJQueryExtScript("vendor/jquery.min.1.12.4.js",function(script){

//set jquery for bootstrap

// if (typeof require === "function") {
// window.jQuery = window.$ = require("jquery");
// }else{

// window.jQuery = window.$ = $;
// }

loadExtScript("vendor/bootstrap-3.3.6-dist/js/bootstrap.js",function(){

loadExtScript("vendor/underscore-min.js",function(){
loadExtScript("vendor/backbone-min.js",function(){

// loadExtScript("vendor/backbone.async.js",function(){

loadExtScript("js/sync.js",function(){

//app.js backbone files
loadExtScript("js/sync.js",function(){
//app.js backbone files
loadExtScript("js/models/transcription.js",function(){
loadExtScript("js/collections/transcriptions.js",function(){
loadExtScript("js/views/transcription_index.js",function(){
Expand All @@ -97,7 +82,7 @@

// jesselynRadackTranscription.save();
//end Demo
})
})
})
})
})
Expand Down Expand Up @@ -467,7 +452,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autoEdit2",
"version": "1.0.0",
"version": "1.0.1",
"description": "Text based video editing app",
"main": "frontEnd/index.html",
"chromium-args": "--mixed-context",
Expand Down

0 comments on commit 689f4a0

Please sign in to comment.