@remotion/openai-whisper 4.0.226 → 4.0.228

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.
@@ -8,7 +8,7 @@ const openAiWhisperApiToCaptions = ({ transcription, }) => {
8
8
  }
9
9
  let remainingText = transcription.text;
10
10
  for (const word of transcription.words) {
11
- const match = new RegExp(`^(^.{0,4})${word.word}([\\?,\\.]{0,3})?`).exec(remainingText);
11
+ const match = new RegExp(`^([\\s\\.]{0,4})${word.word}([\\?,\\.]{0,3})?`).exec(remainingText);
12
12
  if (!match) {
13
13
  throw new Error(`Unable to parse punctuation from OpenAI Whisper output. Could not find word "${word.word}" in text "${remainingText.slice(0, 100)}". File an issue under https://remotion.dev/issue to ask for a fix.`);
14
14
  }
@@ -0,0 +1,2 @@
1
+ import type { OpenAiVerboseTranscription } from '../openai-format';
2
+ export declare const transcript: OpenAiVerboseTranscription;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transcript = void 0;
4
+ const bun_test_1 = require("bun:test");
5
+ const openai_whisper_api_to_captions_1 = require("../openai-whisper-api-to-captions");
6
+ exports.transcript = {
7
+ task: 'transcribe',
8
+ text: 'which is a massive.',
9
+ words: [
10
+ {
11
+ end: 12.180000305175781,
12
+ word: 'which',
13
+ start: 12.079999923706055,
14
+ },
15
+ {
16
+ end: 12.300000190734863,
17
+ word: 'is',
18
+ start: 12.180000305175781,
19
+ },
20
+ {
21
+ end: 12.619999885559082,
22
+ word: 'a',
23
+ start: 12.300000190734863,
24
+ },
25
+ {
26
+ end: 12.779999732971191,
27
+ word: 'massive',
28
+ start: 12.619999885559082,
29
+ },
30
+ ],
31
+ duration: 12.779999732971191,
32
+ language: 'english',
33
+ };
34
+ (0, bun_test_1.test)('Partial word test', () => {
35
+ (0, bun_test_1.expect)((0, openai_whisper_api_to_captions_1.openAiWhisperApiToCaptions)({ transcription: exports.transcript }).captions).toEqual([
36
+ {
37
+ confidence: null,
38
+ endMs: 12180.000305175781,
39
+ startMs: 12079.999923706055,
40
+ text: 'which',
41
+ timestampMs: 12130.000114440918,
42
+ },
43
+ {
44
+ confidence: null,
45
+ endMs: 12300.000190734863,
46
+ startMs: 12180.000305175781,
47
+ text: ' is',
48
+ timestampMs: 12240.000247955322,
49
+ },
50
+ {
51
+ confidence: null,
52
+ endMs: 12619.999885559082,
53
+ startMs: 12300.000190734863,
54
+ text: ' a',
55
+ timestampMs: 12460.000038146973,
56
+ },
57
+ {
58
+ confidence: null,
59
+ endMs: 12779.999732971191,
60
+ startMs: 12619.999885559082,
61
+ text: ' massive.',
62
+ timestampMs: 12699.999809265137,
63
+ },
64
+ ]);
65
+ });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/openai-whisper"
4
4
  },
5
5
  "name": "@remotion/openai-whisper",
6
- "version": "4.0.226",
6
+ "version": "4.0.228",
7
7
  "description": "Work with the output of the OpenAI Whisper API",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -16,11 +16,13 @@
16
16
  "author": "Jonny Burger <jonny@remotion.dev>",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@remotion/captions": "4.0.226"
19
+ "@remotion/captions": "4.0.228"
20
20
  },
21
21
  "peerDependencies": {},
22
22
  "devDependencies": {
23
- "openai": "4.67.1"
23
+ "openai": "4.67.1",
24
+ "eslint": "9.14.0",
25
+ "@remotion/eslint-config-internal": "4.0.228"
24
26
  },
25
27
  "keywords": [
26
28
  "remotion"
@@ -31,7 +33,8 @@
31
33
  "homepage": "https://www.remotion.dev/docs/openai-whisper",
32
34
  "scripts": {
33
35
  "formatting": "prettier src --check",
34
- "lint": "eslint src --ext ts,tsx",
35
- "test": "bun test src"
36
+ "lint": "eslint src",
37
+ "test": "bun test src",
38
+ "make": "tsc -d"
36
39
  }
37
40
  }