File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/stt-adapters/speechmatics Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import generateEntitiesRanges from '../generate-entities-ranges/index.js';
1414const groupWordsInParagraphs = ( words ) => {
1515 const results = [ ] ;
1616 let paragraph = { words : [ ] , text : [ ] } ;
17+ debugger ;
1718
1819 words . forEach ( ( word ) => {
1920 // if word contains punctuation
@@ -41,7 +42,8 @@ const groupWordsInParagraphs = (words) => {
4142const getSpeaker = ( start , speakers ) => {
4243 for ( var speakerIdx in speakers ) {
4344 const speaker = speakers [ speakerIdx ] ;
44- if ( start >= speaker . start & start < speaker . end ) {
45+ const segmentStart = parseFloat ( start ) ;
46+ if ( segmentStart >= speaker . start & segmentStart < speaker . end ) {
4547 return speaker . name ;
4648 }
4749 }
@@ -89,8 +91,8 @@ const speechmaticsToDraft = (speechmaticsJson) => {
8991 tmpSpeakers = speechmaticsJson . speakers ;
9092 tmpSpeakers = tmpSpeakers . map ( ( element ) => {
9193 return ( {
92- start : element . time ,
93- end : ( parseFloat ( element . time ) + parseFloat ( element . duration ) ) . toString ( ) ,
94+ start : parseFloat ( element . time ) ,
95+ end : ( parseFloat ( element . time ) + parseFloat ( element . duration ) ) ,
9496 name : element . name ,
9597 } ) ;
9698 } ) ;
You can’t perform that action at this time.
0 commit comments