@aim-packages/subtitle 0.4.0 → 0.5.0
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.
- package/dist/index.cjs.js +54 -54
- package/dist/index.d.ts +27 -0
- package/dist/index.es.js +857 -790
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -510,6 +510,32 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
510
510
|
*/
|
|
511
511
|
declare function padNumber(num: number, length?: number): string;
|
|
512
512
|
|
|
513
|
+
/**
|
|
514
|
+
* Parakeet 转写结果的类型定义
|
|
515
|
+
*
|
|
516
|
+
* Parakeet 是 Apple 提供的离线语音转写模型,输出的 JSON 包含:
|
|
517
|
+
* - 全文 text
|
|
518
|
+
* - 每个 sub-word token 的时间戳和置信度
|
|
519
|
+
*/
|
|
520
|
+
declare interface ParakeetResult {
|
|
521
|
+
confidence: number;
|
|
522
|
+
duration: number;
|
|
523
|
+
processingTime: number;
|
|
524
|
+
rtfx: number;
|
|
525
|
+
text: string;
|
|
526
|
+
tokenTimings: Array<ParakeetToken>;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
declare function parakeetToAimSegments(json: ParakeetResult): Promise<AimSegments[]>;
|
|
530
|
+
|
|
531
|
+
declare interface ParakeetToken {
|
|
532
|
+
confidence: number;
|
|
533
|
+
endTime: number;
|
|
534
|
+
startTime: number;
|
|
535
|
+
token: string;
|
|
536
|
+
tokenId: number;
|
|
537
|
+
}
|
|
538
|
+
|
|
513
539
|
/**
|
|
514
540
|
* Callback passed as the `onParse` callback to a parser
|
|
515
541
|
*
|
|
@@ -569,6 +595,7 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
569
595
|
tingwuToAimSegments,
|
|
570
596
|
openaiToAimSegments,
|
|
571
597
|
whisperJsonToAimSegments,
|
|
598
|
+
parakeetToAimSegments,
|
|
572
599
|
detectSubtitleType,
|
|
573
600
|
parseSubtitle,
|
|
574
601
|
create as createWhisperStreamParser,
|