Skip to content

Commit 6ebe48d

Browse files
authored
removes call to interpolationOptimization to address timestamp sync bug (#249)
1 parent a72b14d commit 6ebe48d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/components/timed-text-editor/UpdateTimestamps/stt-align-node.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,13 @@ function adjustTimecodesBoundaries(words) {
100100
}
101101

102102
function interpolate(wordsList) {
103-
const words = interpolationOptimization(wordsList);
104-
const indicies = [ ...Array(words.length).keys() ];
103+
const indicies = [ ...Array(wordsList.length).keys() ];
105104
const indiciesWithStart = [];
106105
const indiciesWithEnd = [];
107106
const startTimes = [];
108107
const endTimes = [];
109108

110-
words.forEach((word, index) => {
109+
wordsList.forEach((word, index) => {
111110
if ('start' in word) {
112111
indiciesWithStart.push(index);
113112
startTimes.push(word.start);
@@ -121,7 +120,7 @@ function interpolate(wordsList) {
121120
// http://borischumichev.github.io/everpolate/#linear
122121
const outStartTimes = everpolate.linear(indicies, indiciesWithStart, startTimes);
123122
const outEndTimes = everpolate.linear(indicies, indiciesWithEnd, endTimes);
124-
const wordsResults = words.map((word, index) => {
123+
const wordsResults = wordsList.map((word, index) => {
125124
if (!('start' in word)) {
126125
word.start = outStartTimes[index];
127126
}

0 commit comments

Comments
 (0)