@remotion/install-whisper-cpp 4.0.364 → 4.0.365

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,931 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const captions_1 = require("@remotion/captions");
4
- const bun_test_1 = require("bun:test");
5
- const convert_to_captions_1 = require("../convert-to-captions");
6
- const to_captions_1 = require("../to-captions");
7
- const example_payload_1 = require("./example-payload");
8
- (0, bun_test_1.test)('Convert to captions - 200ms together', async () => {
9
- const { captions } = (0, to_captions_1.toCaptions)({
10
- whisperCppOutput: example_payload_1.examplePayload,
11
- });
12
- const { pages } = (0, captions_1.createTikTokStyleCaptions)({
13
- captions,
14
- combineTokensWithinMilliseconds: 200,
15
- });
16
- (0, bun_test_1.expect)(pages).toEqual([
17
- {
18
- text: 'William',
19
- startMs: 40,
20
- tokens: [{ text: 'William', fromMs: 40, toMs: 420 }],
21
- durationMs: 380,
22
- },
23
- {
24
- text: 'just',
25
- startMs: 420,
26
- tokens: [{ text: 'just', fromMs: 420, toMs: 650 }],
27
- durationMs: 230,
28
- },
29
- {
30
- text: 'hit 100,000',
31
- startMs: 650,
32
- tokens: [
33
- { text: 'hit', fromMs: 650, toMs: 810 },
34
- { text: ' 100', fromMs: 810, toMs: 1330 },
35
- { text: ',', fromMs: 1330, toMs: 1440 },
36
- { text: '000', fromMs: 1440, toMs: 1950 },
37
- ],
38
- durationMs: 1300,
39
- },
40
- {
41
- text: 'YouTube',
42
- startMs: 1950,
43
- tokens: [{ text: 'YouTube', fromMs: 1950, toMs: 2370 }],
44
- durationMs: 420,
45
- },
46
- {
47
- text: 'subscribers',
48
- startMs: 2370,
49
- tokens: [{ text: 'subscribers', fromMs: 2370, toMs: 3060 }],
50
- durationMs: 690,
51
- },
52
- {
53
- text: 'And we',
54
- startMs: 3060,
55
- tokens: [
56
- { text: 'And', fromMs: 3060, toMs: 3190 },
57
- { text: ' we', fromMs: 3190, toMs: 3280 },
58
- ],
59
- durationMs: 220,
60
- },
61
- {
62
- text: 'are going',
63
- startMs: 3280,
64
- tokens: [
65
- { text: 'are', fromMs: 3280, toMs: 3410 },
66
- { text: ' going', fromMs: 3410, toMs: 3630 },
67
- ],
68
- durationMs: 350,
69
- },
70
- {
71
- text: 'to celebrate',
72
- startMs: 3630,
73
- tokens: [
74
- { text: 'to', fromMs: 3630, toMs: 3710 },
75
- { text: ' celebrate', fromMs: 3710, toMs: 4130 },
76
- ],
77
- durationMs: 500,
78
- },
79
- {
80
- text: 'that',
81
- startMs: 4130,
82
- tokens: [{ text: 'that', fromMs: 4130, toMs: 4340 }],
83
- durationMs: 210,
84
- },
85
- {
86
- text: 'We thought',
87
- startMs: 4340,
88
- tokens: [
89
- { text: 'We', fromMs: 4340, toMs: 4500 },
90
- { text: ' thought', fromMs: 4500, toMs: 5140 },
91
- ],
92
- durationMs: 800,
93
- },
94
- {
95
- text: 'about',
96
- startMs: 5140,
97
- tokens: [{ text: 'about', fromMs: 5140, toMs: 5480 }],
98
- durationMs: 340,
99
- },
100
- {
101
- text: 'to bake',
102
- startMs: 5480,
103
- tokens: [
104
- { text: 'to', fromMs: 5480, toMs: 5660 },
105
- { text: ' bake', fromMs: 5660, toMs: 5980 },
106
- ],
107
- durationMs: 500,
108
- },
109
- {
110
- text: 'a cake',
111
- startMs: 5980,
112
- tokens: [
113
- { text: 'a', fromMs: 5980, toMs: 6080 },
114
- { text: ' cake', fromMs: 6080, toMs: 6400 },
115
- ],
116
- durationMs: 420,
117
- },
118
- {
119
- text: 'We found',
120
- startMs: 6400,
121
- tokens: [
122
- { text: 'We', fromMs: 6400, toMs: 6540 },
123
- { text: ' found', fromMs: 6540, toMs: 6900 },
124
- ],
125
- durationMs: 500,
126
- },
127
- {
128
- text: 'this',
129
- startMs: 6900,
130
- tokens: [{ text: 'this', fromMs: 6900, toMs: 7200 }],
131
- durationMs: 300,
132
- },
133
- {
134
- text: 'and it',
135
- startMs: 7200,
136
- tokens: [
137
- { text: 'and', fromMs: 7200, toMs: 7390 },
138
- { text: ' it', fromMs: 7390, toMs: 7510 },
139
- ],
140
- durationMs: 310,
141
- },
142
- {
143
- text: 'reminded',
144
- startMs: 7510,
145
- tokens: [{ text: 'reminded', fromMs: 7510, toMs: 8030 }],
146
- durationMs: 520,
147
- },
148
- {
149
- text: 'us of',
150
- startMs: 8030,
151
- tokens: [
152
- { text: 'us', fromMs: 8030, toMs: 8170 },
153
- { text: ' of', fromMs: 8170, toMs: 8260 },
154
- ],
155
- durationMs: 230,
156
- },
157
- {
158
- text: 'William',
159
- startMs: 8260,
160
- tokens: [{ text: 'William', fromMs: 8260, toMs: 8740 }],
161
- durationMs: 480,
162
- },
163
- {
164
- text: 'We hope',
165
- startMs: 8740,
166
- tokens: [
167
- { text: 'We', fromMs: 8740, toMs: 8850 },
168
- { text: ' hope', fromMs: 8850, toMs: 9080 },
169
- ],
170
- durationMs: 340,
171
- },
172
- {
173
- text: 'he will',
174
- startMs: 9080,
175
- tokens: [
176
- { text: 'he', fromMs: 9080, toMs: 9190 },
177
- { text: ' will', fromMs: 9190, toMs: 9420 },
178
- ],
179
- durationMs: 340,
180
- },
181
- {
182
- text: 'like',
183
- startMs: 9420,
184
- tokens: [{ text: 'like', fromMs: 9420, toMs: 9650 }],
185
- durationMs: 230,
186
- },
187
- {
188
- text: 'the cake',
189
- startMs: 9650,
190
- tokens: [
191
- { text: 'the', fromMs: 9650, toMs: 9820 },
192
- { text: ' cake', fromMs: 9820, toMs: 10100 },
193
- ],
194
- durationMs: 450,
195
- },
196
- {
197
- text: "Let's start",
198
- startMs: 10100,
199
- tokens: [
200
- { text: 'Let', fromMs: 10100, toMs: 10220 },
201
- { text: "'s", fromMs: 10220, toMs: 10300 },
202
- { text: ' start', fromMs: 10300, toMs: 10570 },
203
- ],
204
- durationMs: 470,
205
- },
206
- {
207
- text: 'with the',
208
- startMs: 10570,
209
- tokens: [
210
- { text: 'with', fromMs: 10570, toMs: 10700 },
211
- { text: ' the', fromMs: 10700, toMs: 10780 },
212
- ],
213
- durationMs: 210,
214
- },
215
- {
216
- text: 'dough',
217
- startMs: 10780,
218
- tokens: [{ text: 'dough', fromMs: 10780, toMs: 11000 }],
219
- durationMs: 220,
220
- },
221
- {
222
- text: 'By putting',
223
- startMs: 11000,
224
- tokens: [
225
- { text: 'By', fromMs: 11000, toMs: 11120 },
226
- { text: ' putting', fromMs: 11120, toMs: 11550 },
227
- ],
228
- durationMs: 550,
229
- },
230
- {
231
- text: 'some',
232
- startMs: 11550,
233
- tokens: [{ text: 'some', fromMs: 11550, toMs: 11790 }],
234
- durationMs: 240,
235
- },
236
- {
237
- text: 'butter',
238
- startMs: 11790,
239
- tokens: [{ text: 'butter', fromMs: 11790, toMs: 12180 }],
240
- durationMs: 390,
241
- },
242
- {
243
- text: 'Some',
244
- startMs: 12180,
245
- tokens: [{ text: 'Some', fromMs: 12180, toMs: 12750 }],
246
- durationMs: 570,
247
- },
248
- {
249
- text: 'sugar',
250
- startMs: 12750,
251
- tokens: [{ text: 'sugar', fromMs: 12750, toMs: 13380 }],
252
- durationMs: 630,
253
- },
254
- {
255
- text: 'Eggs',
256
- startMs: 13380,
257
- tokens: [{ text: 'Eggs', fromMs: 13380, toMs: 14580 }],
258
- durationMs: 1200,
259
- },
260
- {
261
- text: 'No frameworks,',
262
- startMs: 14580,
263
- tokens: [
264
- { text: 'No', fromMs: 14580, toMs: 14720 },
265
- { text: ' frameworks', fromMs: 14720, toMs: 15440 },
266
- { text: ',', fromMs: 15440, toMs: 15550 },
267
- ],
268
- durationMs: 970,
269
- },
270
- {
271
- text: 'just',
272
- startMs: 15550,
273
- tokens: [{ text: 'just', fromMs: 15550, toMs: 15790 }],
274
- durationMs: 240,
275
- },
276
- {
277
- text: 'vanilla',
278
- startMs: 15790,
279
- tokens: [{ text: 'vanilla', fromMs: 15790, toMs: 16220 }],
280
- durationMs: 430,
281
- },
282
- {
283
- text: 'Pinch',
284
- startMs: 16220,
285
- tokens: [
286
- { text: 'P', fromMs: 16220, toMs: 16300 },
287
- { text: 'inch', fromMs: 16300, toMs: 16640 },
288
- ],
289
- durationMs: 420,
290
- },
291
- {
292
- text: 'of salt',
293
- startMs: 16640,
294
- tokens: [
295
- { text: 'of', fromMs: 16640, toMs: 16810 },
296
- { text: ' salt', fromMs: 16810, toMs: 17180 },
297
- ],
298
- durationMs: 540,
299
- },
300
- {
301
- text: 'Some',
302
- startMs: 17180,
303
- tokens: [{ text: 'Some', fromMs: 17180, toMs: 17480 }],
304
- durationMs: 300,
305
- },
306
- {
307
- text: 'Nutella',
308
- startMs: 17480,
309
- tokens: [
310
- { text: 'Nut', fromMs: 17480, toMs: 17700 },
311
- { text: 'ella', fromMs: 17700, toMs: 18020 },
312
- ],
313
- durationMs: 540,
314
- },
315
- {
316
- text: 'Some',
317
- startMs: 18020,
318
- tokens: [{ text: 'Some', fromMs: 18020, toMs: 18280 }],
319
- durationMs: 260,
320
- },
321
- {
322
- text: 'chocolate',
323
- startMs: 18280,
324
- tokens: [{ text: 'chocolate', fromMs: 18280, toMs: 18880 }],
325
- durationMs: 600,
326
- },
327
- {
328
- text: 'Baking',
329
- startMs: 18880,
330
- tokens: [
331
- { text: 'B', fromMs: 18880, toMs: 18980 },
332
- { text: 'aking', fromMs: 18980, toMs: 19420 },
333
- ],
334
- durationMs: 540,
335
- },
336
- {
337
- text: 'powder',
338
- startMs: 19420,
339
- tokens: [{ text: 'powder', fromMs: 19420, toMs: 19980 }],
340
- durationMs: 560,
341
- },
342
- {
343
- text: 'And',
344
- startMs: 19980,
345
- tokens: [{ text: 'And', fromMs: 19980, toMs: 20500 }],
346
- durationMs: 520,
347
- },
348
- {
349
- text: 'flour',
350
- startMs: 20500,
351
- tokens: [{ text: 'flour', fromMs: 20500, toMs: 21380 }],
352
- durationMs: 880,
353
- },
354
- {
355
- text: 'Just',
356
- startMs: 21380,
357
- tokens: [{ text: 'Just', fromMs: 21380, toMs: 21690 }],
358
- durationMs: 310,
359
- },
360
- {
361
- text: 'massage',
362
- startMs: 21690,
363
- tokens: [{ text: 'massage', fromMs: 21690, toMs: 22120 }],
364
- durationMs: 430,
365
- },
366
- {
367
- text: 'in the',
368
- startMs: 22120,
369
- tokens: [
370
- { text: 'in', fromMs: 22120, toMs: 22250 },
371
- { text: ' the', fromMs: 22250, toMs: 22450 },
372
- ],
373
- durationMs: 330,
374
- },
375
- {
376
- text: 'butter',
377
- startMs: 22450,
378
- tokens: [{ text: 'butter', fromMs: 22450, toMs: 22880 }],
379
- durationMs: 430,
380
- },
381
- {
382
- text: 'to give',
383
- startMs: 22880,
384
- tokens: [
385
- { text: 'to', fromMs: 22880, toMs: 23000 },
386
- { text: ' give', fromMs: 23000, toMs: 23250 },
387
- ],
388
- durationMs: 370,
389
- },
390
- {
391
- text: 'it the',
392
- startMs: 23250,
393
- tokens: [
394
- { text: 'it', fromMs: 23250, toMs: 23380 },
395
- { text: ' the', fromMs: 23380, toMs: 23590 },
396
- ],
397
- durationMs: 340,
398
- },
399
- {
400
- text: 'full',
401
- startMs: 23590,
402
- tokens: [{ text: 'full', fromMs: 23590, toMs: 23890 }],
403
- durationMs: 300,
404
- },
405
- {
406
- text: 'treatment',
407
- startMs: 23890,
408
- tokens: [{ text: 'treatment', fromMs: 23890, toMs: 24380 }],
409
- durationMs: 490,
410
- },
411
- {
412
- text: 'Fill',
413
- startMs: 24380,
414
- tokens: [{ text: 'Fill', fromMs: 24380, toMs: 24740 }],
415
- durationMs: 360,
416
- },
417
- {
418
- text: 'it in',
419
- startMs: 24740,
420
- tokens: [
421
- { text: 'it', fromMs: 24740, toMs: 24920 },
422
- { text: ' in', fromMs: 24920, toMs: 25120 },
423
- ],
424
- durationMs: 380,
425
- },
426
- {
427
- text: 'Bake',
428
- startMs: 25120,
429
- tokens: [{ text: 'Bake', fromMs: 25120, toMs: 25570 }],
430
- durationMs: 450,
431
- },
432
- {
433
- text: 'it for',
434
- startMs: 25570,
435
- tokens: [
436
- { text: 'it', fromMs: 25570, toMs: 25770 },
437
- { text: ' for', fromMs: 25770, toMs: 26060 },
438
- ],
439
- durationMs: 490,
440
- },
441
- {
442
- text: 'half',
443
- startMs: 26060,
444
- tokens: [{ text: 'half', fromMs: 26060, toMs: 26480 }],
445
- durationMs: 420,
446
- },
447
- {
448
- text: 'an',
449
- startMs: 26480,
450
- tokens: [{ text: 'an', fromMs: 26480, toMs: 26690 }],
451
- durationMs: 210,
452
- },
453
- {
454
- text: 'hour',
455
- startMs: 26690,
456
- tokens: [{ text: 'hour', fromMs: 26690, toMs: 27110 }],
457
- durationMs: 420,
458
- },
459
- {
460
- text: 'at 170',
461
- startMs: 27110,
462
- tokens: [
463
- { text: 'at', fromMs: 27110, toMs: 27300 },
464
- { text: ' 170', fromMs: 27300, toMs: 28170 },
465
- ],
466
- durationMs: 1060,
467
- },
468
- {
469
- text: 'degrees',
470
- startMs: 28170,
471
- tokens: [{ text: 'degrees', fromMs: 28170, toMs: 28800 }],
472
- durationMs: 680,
473
- },
474
- {
475
- text: "It's time",
476
- startMs: 28850,
477
- tokens: [
478
- { text: 'It', fromMs: 28850, toMs: 28900 },
479
- { text: "'s", fromMs: 28900, toMs: 29000 },
480
- { text: ' time', fromMs: 29000, toMs: 29210 },
481
- ],
482
- durationMs: 360,
483
- },
484
- {
485
- text: 'for the',
486
- startMs: 29210,
487
- tokens: [
488
- { text: 'for', fromMs: 29210, toMs: 29400 },
489
- { text: ' the', fromMs: 29400, toMs: 29530 },
490
- ],
491
- durationMs: 320,
492
- },
493
- {
494
- text: 'icing',
495
- startMs: 29530,
496
- tokens: [{ text: 'icing', fromMs: 29530, toMs: 29800 }],
497
- durationMs: 270,
498
- },
499
- {
500
- text: 'on the',
501
- startMs: 29800,
502
- tokens: [
503
- { text: 'on', fromMs: 29800, toMs: 29900 },
504
- { text: ' the', fromMs: 29900, toMs: 30060 },
505
- ],
506
- durationMs: 260,
507
- },
508
- {
509
- text: 'cake',
510
- startMs: 30060,
511
- tokens: [{ text: 'cake', fromMs: 30060, toMs: 30320 }],
512
- durationMs: 260,
513
- },
514
- {
515
- text: 'Time',
516
- startMs: 30320,
517
- tokens: [{ text: 'Time', fromMs: 30320, toMs: 30940 }],
518
- durationMs: 620,
519
- },
520
- {
521
- text: 'for',
522
- startMs: 30940,
523
- tokens: [{ text: 'for', fromMs: 30940, toMs: 31410 }],
524
- durationMs: 470,
525
- },
526
- {
527
- text: 'the',
528
- startMs: 31410,
529
- tokens: [{ text: 'the', fromMs: 31410, toMs: 31880 }],
530
- durationMs: 470,
531
- },
532
- {
533
- text: 'most',
534
- startMs: 31880,
535
- tokens: [{ text: 'most', fromMs: 31880, toMs: 32500 }],
536
- durationMs: 620,
537
- },
538
- {
539
- text: 'critical',
540
- startMs: 32500,
541
- tokens: [{ text: 'critical', fromMs: 32500, toMs: 33750 }],
542
- durationMs: 1250,
543
- },
544
- {
545
- text: 'part',
546
- startMs: 33750,
547
- tokens: [{ text: 'part', fromMs: 33750, toMs: 34400 }],
548
- durationMs: 650,
549
- },
550
- {
551
- text: 'This',
552
- startMs: 34400,
553
- tokens: [{ text: 'This', fromMs: 34400, toMs: 35840 }],
554
- durationMs: 1440,
555
- },
556
- {
557
- text: 'is',
558
- startMs: 35840,
559
- tokens: [{ text: 'is', fromMs: 35840, toMs: 36580 }],
560
- durationMs: 740,
561
- },
562
- {
563
- text: 'how',
564
- startMs: 36580,
565
- tokens: [{ text: 'how', fromMs: 36580, toMs: 37670 }],
566
- durationMs: 1090,
567
- },
568
- {
569
- text: 'it',
570
- startMs: 37670,
571
- tokens: [{ text: 'it', fromMs: 37670, toMs: 38420 }],
572
- durationMs: 750,
573
- },
574
- {
575
- text: 'turned',
576
- startMs: 38420,
577
- tokens: [{ text: 'turned', fromMs: 38420, toMs: 40580 }],
578
- durationMs: 2160,
579
- },
580
- {
581
- text: 'out',
582
- startMs: 40580,
583
- tokens: [{ text: 'out', fromMs: 40580, toMs: 41700 }],
584
- durationMs: 1120,
585
- },
586
- {
587
- text: 'Stupid',
588
- startMs: 41700,
589
- tokens: [{ text: 'Stupid', fromMs: 41700, toMs: 42750 }],
590
- durationMs: 1050,
591
- },
592
- {
593
- text: 'idea,',
594
- startMs: 42750,
595
- tokens: [
596
- { text: 'idea', fromMs: 42750, toMs: 43440 },
597
- { text: ',', fromMs: 43440, toMs: 43590 },
598
- ],
599
- durationMs: 840,
600
- },
601
- {
602
- text: 'pretty',
603
- startMs: 43590,
604
- tokens: [{ text: 'pretty', fromMs: 43590, toMs: 44070 }],
605
- durationMs: 480,
606
- },
607
- {
608
- text: 'bad',
609
- startMs: 44070,
610
- tokens: [{ text: 'bad', fromMs: 44070, toMs: 44310 }],
611
- durationMs: 240,
612
- },
613
- {
614
- text: 'execution',
615
- startMs: 44310,
616
- tokens: [{ text: 'execution', fromMs: 44310, toMs: 45040 }],
617
- durationMs: 730,
618
- },
619
- {
620
- text: 'I hope',
621
- startMs: 45040,
622
- tokens: [
623
- { text: 'I', fromMs: 45040, toMs: 45140 },
624
- { text: ' hope', fromMs: 45140, toMs: 45530 },
625
- ],
626
- durationMs: 490,
627
- },
628
- {
629
- text: 'he likes',
630
- startMs: 45530,
631
- tokens: [
632
- { text: 'he', fromMs: 45530, toMs: 45730 },
633
- { text: ' likes', fromMs: 45730, toMs: 46220 },
634
- ],
635
- durationMs: 690,
636
- },
637
- {
638
- text: 'it anyway',
639
- startMs: 46220,
640
- tokens: [
641
- { text: 'it', fromMs: 46220, toMs: 46420 },
642
- { text: ' anyway', fromMs: 46420, toMs: 47040 },
643
- ],
644
- durationMs: 820,
645
- },
646
- {
647
- text: 'Hey',
648
- startMs: 47040,
649
- tokens: [{ text: 'Hey', fromMs: 47040, toMs: 48030 }],
650
- durationMs: 990,
651
- },
652
- {
653
- text: 'William',
654
- startMs: 48030,
655
- tokens: [{ text: 'William', fromMs: 48030, toMs: 50340 }],
656
- durationMs: 2310,
657
- },
658
- {
659
- text: 'Congrats',
660
- startMs: 50340,
661
- tokens: [
662
- { text: 'Cong', fromMs: 50340, toMs: 51970 },
663
- { text: 'rats', fromMs: 51970, toMs: 53580 },
664
- ],
665
- durationMs: 3240,
666
- },
667
- {
668
- text: 'We',
669
- startMs: 53580,
670
- tokens: [{ text: 'We', fromMs: 53580, toMs: 53790 }],
671
- durationMs: 210,
672
- },
673
- {
674
- text: 'wanted',
675
- startMs: 53790,
676
- tokens: [{ text: 'wanted', fromMs: 53790, toMs: 54440 }],
677
- durationMs: 650,
678
- },
679
- {
680
- text: 'to congratulate',
681
- startMs: 54440,
682
- tokens: [
683
- { text: 'to', fromMs: 54440, toMs: 54640 },
684
- { text: ' congratulate', fromMs: 54640, toMs: 55930 },
685
- ],
686
- durationMs: 1490,
687
- },
688
- {
689
- text: 'you',
690
- startMs: 55930,
691
- tokens: [{ text: 'you', fromMs: 55930, toMs: 56280 }],
692
- durationMs: 350,
693
- },
694
- {
695
- text: 'on',
696
- startMs: 56280,
697
- tokens: [{ text: 'on', fromMs: 56280, toMs: 56520 }],
698
- durationMs: 240,
699
- },
700
- {
701
- text: 'the',
702
- startMs: 56520,
703
- tokens: [{ text: 'the', fromMs: 56520, toMs: 56880 }],
704
- durationMs: 360,
705
- },
706
- {
707
- text: '100,000',
708
- startMs: 56880,
709
- tokens: [
710
- { text: '100', fromMs: 56880, toMs: 57980 },
711
- { text: ',', fromMs: 57980, toMs: 58010 },
712
- { text: '000', fromMs: 58010, toMs: 58180 },
713
- ],
714
- durationMs: 1810,
715
- },
716
- {
717
- text: 'You hear',
718
- startMs: 58690,
719
- tokens: [
720
- { text: 'You', fromMs: 58690, toMs: 58870 },
721
- { text: ' hear', fromMs: 58870, toMs: 59150 },
722
- ],
723
- durationMs: 460,
724
- },
725
- {
726
- text: 'Joseph',
727
- startMs: 59150,
728
- tokens: [{ text: 'Joseph', fromMs: 59150, toMs: 59570 }],
729
- durationMs: 420,
730
- },
731
- {
732
- text: 'crying?',
733
- startMs: 59570,
734
- tokens: [
735
- { text: 'crying', fromMs: 59570, toMs: 59990 },
736
- { text: '?', fromMs: 59990, toMs: 60220 },
737
- ],
738
- durationMs: 650,
739
- },
740
- {
741
- text: 'Thank',
742
- startMs: 60220,
743
- tokens: [{ text: 'Thank', fromMs: 60220, toMs: 60820 }],
744
- durationMs: 600,
745
- },
746
- {
747
- text: 'you',
748
- startMs: 60820,
749
- tokens: [{ text: 'you', fromMs: 60820, toMs: 61180 }],
750
- durationMs: 360,
751
- },
752
- {
753
- text: 'so',
754
- startMs: 61180,
755
- tokens: [{ text: 'so', fromMs: 61180, toMs: 61420 }],
756
- durationMs: 240,
757
- },
758
- {
759
- text: 'much',
760
- startMs: 61420,
761
- tokens: [{ text: 'much', fromMs: 61420, toMs: 61920 }],
762
- durationMs: 500,
763
- },
764
- {
765
- text: '(electronic',
766
- startMs: 61920,
767
- tokens: [
768
- { text: '(', fromMs: 61920, toMs: 62080 },
769
- { text: 'elect', fromMs: 62080, toMs: 62880 },
770
- { text: 'ronic', fromMs: 62880, toMs: 63680 },
771
- ],
772
- durationMs: 1760,
773
- },
774
- {
775
- text: 'beeping)',
776
- startMs: 63680,
777
- tokens: [
778
- { text: 'be', fromMs: 63680, toMs: 63890 },
779
- { text: 'eping', fromMs: 63890, toMs: 64800 },
780
- { text: ')', fromMs: 64800, toMs: 65000 },
781
- ],
782
- durationMs: 1320,
783
- },
784
- ]);
785
- });
786
- (0, bun_test_1.test)('Convert to captions - 0ms together', () => {
787
- const { captions: transcript } = (0, convert_to_captions_1.convertToCaptions)({
788
- transcription: example_payload_1.examplePayload.transcription,
789
- combineTokensWithinMilliseconds: 0,
790
- });
791
- (0, bun_test_1.expect)(transcript).toEqual([
792
- { text: 'William', startInSeconds: 0.24 },
793
- { text: 'just', startInSeconds: 0.48 },
794
- { text: 'hit', startInSeconds: 0.7 },
795
- { text: '100,000', startInSeconds: 1.3 },
796
- { text: 'YouTube', startInSeconds: 2.22 },
797
- { text: 'subscribers', startInSeconds: 2.94 },
798
- { text: 'And', startInSeconds: 3.24 },
799
- { text: 'we', startInSeconds: 3.32 },
800
- { text: 'are', startInSeconds: 3.42 },
801
- { text: 'going', startInSeconds: 3.58 },
802
- { text: 'to', startInSeconds: 3.76 },
803
- { text: 'celebrate', startInSeconds: 4.1 },
804
- { text: 'that', startInSeconds: 4.34 },
805
- { text: 'We', startInSeconds: 4.5 },
806
- { text: 'thought', startInSeconds: 4.7 },
807
- { text: 'about', startInSeconds: 5.1 },
808
- { text: 'to', startInSeconds: 5.42 },
809
- { text: 'bake', startInSeconds: 5.92 },
810
- { text: 'a', startInSeconds: 6.14 },
811
- { text: 'cake', startInSeconds: 6.4 },
812
- { text: 'We', startInSeconds: 6.56 },
813
- { text: 'found', startInSeconds: 6.8 },
814
- { text: 'this', startInSeconds: 7.12 },
815
- { text: 'and', startInSeconds: 7.36 },
816
- { text: 'it', startInSeconds: 7.5 },
817
- { text: 'reminded', startInSeconds: 7.78 },
818
- { text: 'us', startInSeconds: 8.04 },
819
- { text: 'of', startInSeconds: 8.24 },
820
- { text: 'William', startInSeconds: 8.52 },
821
- { text: 'We', startInSeconds: 8.94 },
822
- { text: 'hope', startInSeconds: 9.22 },
823
- { text: 'he', startInSeconds: 9.42 },
824
- { text: 'will', startInSeconds: 9.56 },
825
- { text: 'like', startInSeconds: 9.68 },
826
- { text: 'the', startInSeconds: 9.86 },
827
- { text: 'cake', startInSeconds: 10.08 },
828
- { text: "Let's", startInSeconds: 10.28 },
829
- { text: 'start', startInSeconds: 10.46 },
830
- { text: 'with', startInSeconds: 10.58 },
831
- { text: 'the', startInSeconds: 10.68 },
832
- { text: 'dough', startInSeconds: 10.96 },
833
- { text: 'By', startInSeconds: 11.2 },
834
- { text: 'putting', startInSeconds: 11.44 },
835
- { text: 'some', startInSeconds: 11.64 },
836
- { text: 'butter', startInSeconds: 12.06 },
837
- { text: 'Some', startInSeconds: 12.86 },
838
- { text: 'sugar', startInSeconds: 13.3 },
839
- { text: 'Eggs', startInSeconds: 14.36 },
840
- { text: 'No', startInSeconds: 14.78 },
841
- { text: 'frameworks,', startInSeconds: 15.28 },
842
- { text: 'just', startInSeconds: 15.68 },
843
- { text: 'vanilla', startInSeconds: 16.1 },
844
- { text: 'Pinch', startInSeconds: 16.38 },
845
- { text: 'of', startInSeconds: 16.58 },
846
- { text: 'salt', startInSeconds: 17.08 },
847
- { text: 'Some', startInSeconds: 17.44 },
848
- { text: 'Nutella', startInSeconds: 17.78 },
849
- { text: 'Some', startInSeconds: 18.3 },
850
- { text: 'chocolate', startInSeconds: 18.68 },
851
- { text: 'Baking', startInSeconds: 19.12 },
852
- { text: 'powder', startInSeconds: 19.76 },
853
- { text: 'And', startInSeconds: 20.68 },
854
- { text: 'flour', startInSeconds: 21.14 },
855
- { text: 'Just', startInSeconds: 21.66 },
856
- { text: 'massage', startInSeconds: 22.06 },
857
- { text: 'in', startInSeconds: 22.38 },
858
- { text: 'the', startInSeconds: 22.5 },
859
- { text: 'butter', startInSeconds: 22.84 },
860
- { text: 'to', startInSeconds: 23.08 },
861
- { text: 'give', startInSeconds: 23.18 },
862
- { text: 'it', startInSeconds: 23.32 },
863
- { text: 'the', startInSeconds: 23.42 },
864
- { text: 'full', startInSeconds: 23.76 },
865
- { text: 'treatment', startInSeconds: 24.28 },
866
- { text: 'Fill', startInSeconds: 24.54 },
867
- { text: 'it', startInSeconds: 24.7 },
868
- { text: 'in', startInSeconds: 25.32 },
869
- { text: 'Bake', startInSeconds: 26.1 },
870
- { text: 'it', startInSeconds: 26.3 },
871
- { text: 'for', startInSeconds: 26.48 },
872
- { text: 'half', startInSeconds: 26.64 },
873
- { text: 'an', startInSeconds: 26.86 },
874
- { text: 'hour', startInSeconds: 27.06 },
875
- { text: 'at', startInSeconds: 27.4 },
876
- { text: '170', startInSeconds: 28.14 },
877
- { text: 'degrees', startInSeconds: 28.6 },
878
- { text: "It's", startInSeconds: 28.84 },
879
- { text: 'time', startInSeconds: 29.04 },
880
- { text: 'for', startInSeconds: 29.28 },
881
- { text: 'the', startInSeconds: 29.42 },
882
- { text: 'icing', startInSeconds: 29.7 },
883
- { text: 'on', startInSeconds: 29.88 },
884
- { text: 'the', startInSeconds: 30.0 },
885
- { text: 'cake', startInSeconds: 30.56 },
886
- { text: 'Time', startInSeconds: 33.14 },
887
- { text: 'for', startInSeconds: 33.34 },
888
- { text: 'the', startInSeconds: 33.46 },
889
- { text: 'most', startInSeconds: 33.62 },
890
- { text: 'critical', startInSeconds: 34.0 },
891
- { text: 'part', startInSeconds: 34.76 },
892
- { text: 'This', startInSeconds: 40.74 },
893
- { text: 'is', startInSeconds: 40.86 },
894
- { text: 'how', startInSeconds: 41.0 },
895
- { text: 'it', startInSeconds: 41.1 },
896
- { text: 'turned', startInSeconds: 41.32 },
897
- { text: 'out', startInSeconds: 42.02 },
898
- { text: 'Stupid', startInSeconds: 42.78 },
899
- { text: 'idea,', startInSeconds: 43.36 },
900
- { text: 'pretty', startInSeconds: 43.7 },
901
- { text: 'bad', startInSeconds: 44.02 },
902
- { text: 'execution', startInSeconds: 44.72 },
903
- { text: 'I', startInSeconds: 45.88 },
904
- { text: 'hope', startInSeconds: 46.06 },
905
- { text: 'he', startInSeconds: 46.2 },
906
- { text: 'likes', startInSeconds: 46.38 },
907
- { text: 'it', startInSeconds: 46.58 },
908
- { text: 'anyway', startInSeconds: 47.56 },
909
- { text: 'Hey', startInSeconds: 49.52 },
910
- { text: 'William', startInSeconds: 50.06 },
911
- { text: 'Congrats', startInSeconds: 52.32 },
912
- { text: 'We', startInSeconds: 54.56 },
913
- { text: 'wanted', startInSeconds: 54.86 },
914
- { text: 'to', startInSeconds: 55.0 },
915
- { text: 'congratulate', startInSeconds: 55.58 },
916
- { text: 'you', startInSeconds: 56.22 },
917
- { text: 'on', startInSeconds: 56.54 },
918
- { text: 'the', startInSeconds: 56.68 },
919
- { text: '100,000', startInSeconds: 57.14 },
920
- { text: 'You', startInSeconds: 58.86 },
921
- { text: 'hear', startInSeconds: 59.06 },
922
- { text: 'Joseph', startInSeconds: 59.4 },
923
- { text: 'crying?', startInSeconds: 59.74 },
924
- { text: 'Thank', startInSeconds: 61.04 },
925
- { text: 'you', startInSeconds: 61.18 },
926
- { text: 'so', startInSeconds: 61.44 },
927
- { text: 'much', startInSeconds: 61.76 },
928
- { text: '(electronic', startInSeconds: 62.88 },
929
- { text: 'beeping)', startInSeconds: 63.02 },
930
- ]);
931
- });