@norskvideo/norsk-studio-alpha 1.27.0-2025-07-09-0fcad3ea
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/README.md +10 -0
- package/client/info.js +43461 -0
- package/client/processor.audioLevel/styles.css +165 -0
- package/client/shared/style.css +1627 -0
- package/client/shared/tailwind.css +31 -0
- package/client/style.css +1074 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/info.d.ts +3 -0
- package/lib/info.js +44 -0
- package/lib/info.js.map +1 -0
- package/lib/input.decklink/info.d.ts +3 -0
- package/lib/input.decklink/info.js +51 -0
- package/lib/input.decklink/info.js.map +1 -0
- package/lib/input.decklink/runtime.d.ts +12 -0
- package/lib/input.decklink/runtime.js +22 -0
- package/lib/input.decklink/runtime.js.map +1 -0
- package/lib/input.decklink/types.d.ts +23 -0
- package/lib/input.decklink/types.js +3 -0
- package/lib/input.decklink/types.js.map +1 -0
- package/lib/input.decklink/types.yaml +32 -0
- package/lib/input.mp4file/info.d.ts +3 -0
- package/lib/input.mp4file/info.js +34 -0
- package/lib/input.mp4file/info.js.map +1 -0
- package/lib/input.mp4file/runtime.d.ts +14 -0
- package/lib/input.mp4file/runtime.js +33 -0
- package/lib/input.mp4file/runtime.js.map +1 -0
- package/lib/input.mp4file/types.d.ts +23 -0
- package/lib/input.mp4file/types.js +3 -0
- package/lib/input.mp4file/types.js.map +1 -0
- package/lib/input.mp4file/types.yaml +30 -0
- package/lib/input.ndi/info.d.ts +3 -0
- package/lib/input.ndi/info.js +52 -0
- package/lib/input.ndi/info.js.map +1 -0
- package/lib/input.ndi/runtime.d.ts +24 -0
- package/lib/input.ndi/runtime.js +60 -0
- package/lib/input.ndi/runtime.js.map +1 -0
- package/lib/input.ndi/source-selection.d.ts +10 -0
- package/lib/input.ndi/source-selection.js +84 -0
- package/lib/input.ndi/source-selection.js.map +1 -0
- package/lib/input.ndi/types.d.ts +52 -0
- package/lib/input.ndi/types.js +3 -0
- package/lib/input.ndi/types.js.map +1 -0
- package/lib/input.ndi/types.yaml +37 -0
- package/lib/output.ndi/info.d.ts +8 -0
- package/lib/output.ndi/info.js +61 -0
- package/lib/output.ndi/info.js.map +1 -0
- package/lib/output.ndi/inline-view.d.ts +6 -0
- package/lib/output.ndi/inline-view.js +12 -0
- package/lib/output.ndi/inline-view.js.map +1 -0
- package/lib/output.ndi/runtime.d.ts +14 -0
- package/lib/output.ndi/runtime.js +35 -0
- package/lib/output.ndi/runtime.js.map +1 -0
- package/lib/output.ndi/types.d.ts +35 -0
- package/lib/output.ndi/types.js +3 -0
- package/lib/output.ndi/types.js.map +1 -0
- package/lib/output.ndi/types.yaml +72 -0
- package/lib/output.recorder/info.d.ts +10 -0
- package/lib/output.recorder/info.js +79 -0
- package/lib/output.recorder/info.js.map +1 -0
- package/lib/output.recorder/runtime.d.ts +66 -0
- package/lib/output.recorder/runtime.js +301 -0
- package/lib/output.recorder/runtime.js.map +1 -0
- package/lib/output.recorder/types.d.ts +225 -0
- package/lib/output.recorder/types.js +3 -0
- package/lib/output.recorder/types.js.map +1 -0
- package/lib/output.recorder/types.yaml +211 -0
- package/lib/processor.actionReplay/info.d.ts +25 -0
- package/lib/processor.actionReplay/info.js +77 -0
- package/lib/processor.actionReplay/info.js.map +1 -0
- package/lib/processor.actionReplay/runtime.d.ts +38 -0
- package/lib/processor.actionReplay/runtime.js +225 -0
- package/lib/processor.actionReplay/runtime.js.map +1 -0
- package/lib/processor.actionReplay/summary.d.ts +4 -0
- package/lib/processor.actionReplay/summary.js +76 -0
- package/lib/processor.actionReplay/summary.js.map +1 -0
- package/lib/processor.actionReplay/types.d.ts +38 -0
- package/lib/processor.actionReplay/types.js +3 -0
- package/lib/processor.actionReplay/types.js.map +1 -0
- package/lib/processor.actionReplay/types.yaml +74 -0
- package/lib/processor.audioLevel/info.d.ts +27 -0
- package/lib/processor.audioLevel/info.js +61 -0
- package/lib/processor.audioLevel/info.js.map +1 -0
- package/lib/processor.audioLevel/inline-view.d.ts +4 -0
- package/lib/processor.audioLevel/inline-view.js +26 -0
- package/lib/processor.audioLevel/inline-view.js.map +1 -0
- package/lib/processor.audioLevel/runtime.d.ts +26 -0
- package/lib/processor.audioLevel/runtime.js +86 -0
- package/lib/processor.audioLevel/runtime.js.map +1 -0
- package/lib/processor.audioLevel/summary-view.d.ts +7 -0
- package/lib/processor.audioLevel/summary-view.js +37 -0
- package/lib/processor.audioLevel/summary-view.js.map +1 -0
- package/lib/processor.audioLevel/types.d.ts +42 -0
- package/lib/processor.audioLevel/types.js +3 -0
- package/lib/processor.audioLevel/types.js.map +1 -0
- package/lib/processor.audioLevel/types.yaml +83 -0
- package/lib/processor.gemini-poc/info.d.ts +8 -0
- package/lib/processor.gemini-poc/info.js +59 -0
- package/lib/processor.gemini-poc/info.js.map +1 -0
- package/lib/processor.gemini-poc/runtime.d.ts +38 -0
- package/lib/processor.gemini-poc/runtime.js +132 -0
- package/lib/processor.gemini-poc/runtime.js.map +1 -0
- package/lib/processor.gemini-poc/types.d.ts +23 -0
- package/lib/processor.gemini-poc/types.js +3 -0
- package/lib/processor.gemini-poc/types.js.map +1 -0
- package/lib/processor.gemini-poc/types.yaml +43 -0
- package/lib/processor.mixMinus/info.d.ts +7 -0
- package/lib/processor.mixMinus/info.js +40 -0
- package/lib/processor.mixMinus/info.js.map +1 -0
- package/lib/processor.mixMinus/runtime.d.ts +23 -0
- package/lib/processor.mixMinus/runtime.js +85 -0
- package/lib/processor.mixMinus/runtime.js.map +1 -0
- package/lib/processor.mixMinus/types.d.ts +18 -0
- package/lib/processor.mixMinus/types.js +3 -0
- package/lib/processor.mixMinus/types.js.map +1 -0
- package/lib/processor.mixMinus/types.yaml +19 -0
- package/lib/processor.monetise/info.d.ts +3 -0
- package/lib/processor.monetise/info.js +72 -0
- package/lib/processor.monetise/info.js.map +1 -0
- package/lib/processor.monetise/runtime.d.ts +62 -0
- package/lib/processor.monetise/runtime.js +217 -0
- package/lib/processor.monetise/runtime.js.map +1 -0
- package/lib/processor.monetise/summary.d.ts +7 -0
- package/lib/processor.monetise/summary.js +40 -0
- package/lib/processor.monetise/summary.js.map +1 -0
- package/lib/processor.monetise/types.d.ts +16 -0
- package/lib/processor.monetise/types.js +3 -0
- package/lib/processor.monetise/types.js.map +1 -0
- package/lib/processor.monetise/types.yaml +9 -0
- package/lib/processor.whisper-transcribe/info.d.ts +9 -0
- package/lib/processor.whisper-transcribe/info.js +46 -0
- package/lib/processor.whisper-transcribe/info.js.map +1 -0
- package/lib/processor.whisper-transcribe/runtime.d.ts +22 -0
- package/lib/processor.whisper-transcribe/runtime.js +70 -0
- package/lib/processor.whisper-transcribe/runtime.js.map +1 -0
- package/lib/processor.whisper-transcribe/types.d.ts +21 -0
- package/lib/processor.whisper-transcribe/types.js +3 -0
- package/lib/processor.whisper-transcribe/types.js.map +1 -0
- package/lib/processor.whisper-transcribe/types.yaml +28 -0
- package/lib/shared/schemas.d.ts +8 -0
- package/lib/shared/schemas.js +44 -0
- package/lib/shared/schemas.js.map +1 -0
- package/lib/test/output.recorder.d.ts +1 -0
- package/lib/test/output.recorder.js +186 -0
- package/lib/test/output.recorder.js.map +1 -0
- package/lib/util.timestamps/info.d.ts +14 -0
- package/lib/util.timestamps/info.js +64 -0
- package/lib/util.timestamps/info.js.map +1 -0
- package/lib/util.timestamps/inline-view.d.ts +6 -0
- package/lib/util.timestamps/inline-view.js +95 -0
- package/lib/util.timestamps/inline-view.js.map +1 -0
- package/lib/util.timestamps/runtime.d.ts +13 -0
- package/lib/util.timestamps/runtime.js +51 -0
- package/lib/util.timestamps/runtime.js.map +1 -0
- package/lib/util.timestamps/types.d.ts +36 -0
- package/lib/util.timestamps/types.js +3 -0
- package/lib/util.timestamps/types.js.map +1 -0
- package/lib/util.timestamps/types.yaml +74 -0
- package/package.json +57 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/processor.actionRepl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AAC;QAC9C,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,SAAS,kBAAkB;QACzB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IACpE,CAAC;IAED,SAAS,kBAAkB;QACzB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IACpE,CAAC;IAED,SAAS,QAAQ;QACf,IAAI,gBAAgB,EAAE,CAAC;YACrB,gBAAgB,GAAG,KAAK,CAAC;YACzB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,QAAQ;YAC9B,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;;YAEvD,WAAW,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
export type paths = Record<string, never>;
|
2
|
+
export type webhooks = Record<string, never>;
|
3
|
+
export interface components {
|
4
|
+
schemas: {
|
5
|
+
ActionReplayConfig: {
|
6
|
+
id: string;
|
7
|
+
displayName: string;
|
8
|
+
__global: {
|
9
|
+
hardware?: "auto" | "software" | "nvidia" | "nvidiaAV1" | "quadra" | "quadraAV1";
|
10
|
+
};
|
11
|
+
notes?: string;
|
12
|
+
};
|
13
|
+
ActionReplayState: {
|
14
|
+
contentPlayerUrl?: string;
|
15
|
+
replaying: boolean;
|
16
|
+
};
|
17
|
+
ActionReplayEvent: {
|
18
|
+
type: "content-player-created";
|
19
|
+
url: string;
|
20
|
+
} | {
|
21
|
+
type: "replay-started";
|
22
|
+
} | {
|
23
|
+
type: "replay-finished";
|
24
|
+
};
|
25
|
+
ActionReplayCommand: {
|
26
|
+
type: "do-replay";
|
27
|
+
from: number;
|
28
|
+
duration: number;
|
29
|
+
};
|
30
|
+
};
|
31
|
+
responses: never;
|
32
|
+
parameters: never;
|
33
|
+
requestBodies: never;
|
34
|
+
headers: never;
|
35
|
+
pathItems: never;
|
36
|
+
}
|
37
|
+
export type $defs = Record<string, never>;
|
38
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/processor.actionReplay/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Action Replay
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
components:
|
7
|
+
schemas:
|
8
|
+
ActionReplayConfig:
|
9
|
+
type: object
|
10
|
+
properties:
|
11
|
+
id:
|
12
|
+
type: string
|
13
|
+
displayName:
|
14
|
+
type: string
|
15
|
+
__global:
|
16
|
+
type: object
|
17
|
+
properties:
|
18
|
+
hardware:
|
19
|
+
type: string
|
20
|
+
enum: ['auto', 'software', 'nvidia', 'nvidiaAV1', 'quadra', 'quadraAV1']
|
21
|
+
notes:
|
22
|
+
type: string
|
23
|
+
required:
|
24
|
+
- id
|
25
|
+
- displayName
|
26
|
+
- __global
|
27
|
+
|
28
|
+
ActionReplayState:
|
29
|
+
type: object
|
30
|
+
properties:
|
31
|
+
contentPlayerUrl:
|
32
|
+
type: string
|
33
|
+
replaying:
|
34
|
+
type: boolean
|
35
|
+
required:
|
36
|
+
- replaying
|
37
|
+
|
38
|
+
ActionReplayEvent:
|
39
|
+
oneOf:
|
40
|
+
- type: object
|
41
|
+
properties:
|
42
|
+
type:
|
43
|
+
const: 'content-player-created'
|
44
|
+
url:
|
45
|
+
type: string
|
46
|
+
required:
|
47
|
+
- type
|
48
|
+
- url
|
49
|
+
- type: object
|
50
|
+
properties:
|
51
|
+
type:
|
52
|
+
const: 'replay-started'
|
53
|
+
required:
|
54
|
+
- type
|
55
|
+
- type: object
|
56
|
+
properties:
|
57
|
+
type:
|
58
|
+
const: 'replay-finished'
|
59
|
+
required:
|
60
|
+
- type
|
61
|
+
|
62
|
+
ActionReplayCommand:
|
63
|
+
type: object
|
64
|
+
properties:
|
65
|
+
type:
|
66
|
+
const: 'do-replay'
|
67
|
+
from:
|
68
|
+
type: number
|
69
|
+
duration:
|
70
|
+
type: number
|
71
|
+
required:
|
72
|
+
- type
|
73
|
+
- from
|
74
|
+
- duration
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
2
|
+
export default function ({ defineComponent, validation: { Z }, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<{
|
3
|
+
id: string;
|
4
|
+
displayName: string;
|
5
|
+
defaultGain: number;
|
6
|
+
notes?: string;
|
7
|
+
}, {
|
8
|
+
levels?: {
|
9
|
+
peak: number;
|
10
|
+
rms: number;
|
11
|
+
};
|
12
|
+
sliderGain?: number;
|
13
|
+
nodeGain?: number;
|
14
|
+
}, {
|
15
|
+
type: "set-gain";
|
16
|
+
value: number;
|
17
|
+
}, {
|
18
|
+
type: "audio-levels";
|
19
|
+
levels: {
|
20
|
+
peak: number;
|
21
|
+
rms: number;
|
22
|
+
};
|
23
|
+
} | {
|
24
|
+
type: "set-gain";
|
25
|
+
sliderGain: number;
|
26
|
+
nodeGain: number;
|
27
|
+
}>;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.default = default_1;
|
7
|
+
const inline_view_1 = __importDefault(require("./inline-view"));
|
8
|
+
const summary_view_1 = __importDefault(require("./summary-view"));
|
9
|
+
function default_1({ defineComponent, validation: { Z }, }) {
|
10
|
+
return defineComponent({
|
11
|
+
identifier: 'processor.audioLevel',
|
12
|
+
category: 'processor',
|
13
|
+
name: "Audio Levels",
|
14
|
+
description: "Monitors and adjusts the audio levels of an incoming audio stream, providing real-time visualization and control of audio gain.",
|
15
|
+
subscription: {
|
16
|
+
accepts: {
|
17
|
+
type: "simple-stream",
|
18
|
+
audio: true
|
19
|
+
},
|
20
|
+
produces: {
|
21
|
+
type: "simple-stream",
|
22
|
+
audio: true
|
23
|
+
}
|
24
|
+
},
|
25
|
+
extraValidation: function (ctx) {
|
26
|
+
ctx.requireExactAudio(1);
|
27
|
+
},
|
28
|
+
display: (_desc) => { return {}; },
|
29
|
+
css: ["styles.css"],
|
30
|
+
runtime: {
|
31
|
+
initialState: () => ({}),
|
32
|
+
handleEvent(ev, state) {
|
33
|
+
const evType = ev.type;
|
34
|
+
switch (evType) {
|
35
|
+
case 'audio-levels':
|
36
|
+
state.levels = ev.levels;
|
37
|
+
break;
|
38
|
+
case 'set-gain':
|
39
|
+
state.sliderGain = ev.sliderGain;
|
40
|
+
state.nodeGain = ev.nodeGain;
|
41
|
+
break;
|
42
|
+
default:
|
43
|
+
assertUnreachable(evType);
|
44
|
+
}
|
45
|
+
return { ...state };
|
46
|
+
},
|
47
|
+
inline: inline_view_1.default,
|
48
|
+
summary: summary_view_1.default,
|
49
|
+
},
|
50
|
+
configForm: {
|
51
|
+
form: {
|
52
|
+
defaultGain: { help: "The default gain for audio dB", hint: { type: 'numeric', validation: Z.number().gte(-40).lte(40), defaultValue: 0 } },
|
53
|
+
notes: { help: "Notes about this component", hint: { type: 'text', optional: true } },
|
54
|
+
}
|
55
|
+
}
|
56
|
+
});
|
57
|
+
}
|
58
|
+
function assertUnreachable(_) {
|
59
|
+
throw new Error("Didn't expect to get here");
|
60
|
+
}
|
61
|
+
//# sourceMappingURL=info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.audioLevel/info.ts"],"names":[],"mappings":";;;;;AAMA,4BAsDC;AAzDD,gEAAuC;AACvC,kEAAyC;AAEzC,mBAAwB,EACtB,eAAe,EACf,UAAU,EAAE,EAAE,CAAC,EAAE,GACJ;IAGb,OAAO,eAAe,CAA0E;QAC9F,UAAU,EAAE,sBAAsB;QAClC,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,iIAAiI;QAC9I,YAAY,EAAE;YAEZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,IAAI;aACZ;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,IAAI;aACZ;SACF;QACD,eAAe,EAAE,UAAS,GAAG;YAC3B,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;QAClC,GAAG,EAAE,CAAC,YAAY,CAAC;QACnB,OAAO,EAAE;YACP,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YACxB,WAAW,CAAC,EAAE,EAAE,KAAK;gBACnB,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC;gBACvB,QAAQ,MAAM,EAAE,CAAC;oBACf,KAAK,cAAc;wBACjB,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;wBACzB,MAAM;oBACR,KAAK,UAAU;wBACb,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAA;wBAChC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAA;wBAC5B,MAAM;oBACR;wBACE,iBAAiB,CAAC,MAAM,CAAC,CAAA;gBAC7B,CAAC;gBACD,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;YACtB,CAAC;YACD,MAAM,EAAE,qBAAU;YAClB,OAAO,EAAE,sBAAW;SACrB;QACD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,WAAW,EAAE,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE;gBAC3I,KAAK,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;aACtF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { ViewProps } from "@norskvideo/norsk-studio/lib/extension/client-types";
|
2
|
+
import type { AudioLevelState, AudioLevelSettings, AudioLevelCommand } from "./runtime";
|
3
|
+
declare function InlineView({ state, raise }: ViewProps<AudioLevelSettings, AudioLevelState, AudioLevelCommand>): import("react/jsx-runtime").JSX.Element;
|
4
|
+
export default InlineView;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
const react_1 = require("react");
|
5
|
+
function InlineView({ state, raise }) {
|
6
|
+
raise && (0, react_1.useEffect)(raise, []);
|
7
|
+
function percentage(levels) {
|
8
|
+
if (!levels) {
|
9
|
+
return 0;
|
10
|
+
}
|
11
|
+
if (levels.peak == 0 && levels.rms == 0) {
|
12
|
+
return 0;
|
13
|
+
}
|
14
|
+
const rebase = levels.rms - 12.0;
|
15
|
+
const capped = 0 - (rebase / 112);
|
16
|
+
const snapped = Math.floor(capped * 10.0) * 10;
|
17
|
+
return Math.max(0, 100 - snapped);
|
18
|
+
}
|
19
|
+
if (!state.levels) {
|
20
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
21
|
+
}
|
22
|
+
{ }
|
23
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "processor-audioLevel", children: (0, jsx_runtime_1.jsx)("div", { className: "audio-level-container-inline", children: (0, jsx_runtime_1.jsx)("div", { className: "preview-levels-inline", children: (0, jsx_runtime_1.jsx)("div", { className: `preview-level clip-${percentage(state.levels)}` }) }) }) });
|
24
|
+
}
|
25
|
+
exports.default = InlineView;
|
26
|
+
//# sourceMappingURL=inline-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/processor.audioLevel/inline-view.tsx"],"names":[],"mappings":";;;AAEA,iCAAkC;AAElC,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAqE;IACrG,KAAK,IAAI,IAAA,iBAAS,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE9B,SAAS,UAAU,CAAC,MAAkD;QACpE,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAC1B,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAGtD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC;QAGjC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QAGlC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE/C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,kDAAK,CAAA;IACd,CAAC;IAED,CAAC,CAAkF,CAAC;IACpF,OAAO,gCAAK,SAAS,EAAC,sBAAsB,YAC1C,gCAAK,SAAS,EAAC,8BAA8B,YAC3C,gCAAK,SAAS,EAAC,uBAAuB,YACpC,gCAAK,SAAS,EAAE,sBAAsB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAQ,GACpE,GACD,GACF,CAAA;AACT,CAAC;AAED,kBAAe,UAAU,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { AudioGainNode, AudioMeasureLevelsNode, Db, Norsk } from '@norskvideo/norsk-sdk';
|
2
|
+
import { OnCreated, RuntimeUpdates, ServerComponentDefinition, ServerComponentSchemas, StudioComponentInputStream, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomAutoDuplexNode } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
|
+
import { components } from './types';
|
5
|
+
export type AudioLevelSettings = components['schemas']['AudioLevelSettings'];
|
6
|
+
export type AudioLevelState = components['schemas']['AudioLevelState'];
|
7
|
+
export type AudioLevelEvent = components['schemas']['AudioLevelEvent'];
|
8
|
+
export type AudioLevelCommand = components['schemas']['AudioLevelCommand'];
|
9
|
+
export default class AudioLevelDefinition implements ServerComponentDefinition<AudioLevelSettings, AudioLevel, AudioLevelState, AudioLevelCommand, AudioLevelEvent> {
|
10
|
+
schemas(): Promise<ServerComponentSchemas>;
|
11
|
+
create(norsk: Norsk, cfg: AudioLevelSettings, cb: OnCreated<AudioLevel>, { updates }: StudioRuntime<AudioLevelState, AudioLevelCommand, AudioLevelEvent>): Promise<void>;
|
12
|
+
handleCommand(node: AudioLevel, command: AudioLevelCommand): void;
|
13
|
+
}
|
14
|
+
declare class AudioLevel extends CustomAutoDuplexNode {
|
15
|
+
initialised: Promise<void>;
|
16
|
+
norsk: Norsk;
|
17
|
+
updates: RuntimeUpdates<AudioLevelState, AudioLevelCommand, AudioLevelEvent>;
|
18
|
+
cfg: AudioLevelSettings;
|
19
|
+
audioLevels?: AudioMeasureLevelsNode;
|
20
|
+
audioGain?: AudioGainNode;
|
21
|
+
sendSetGainEvent: (relativeGain: Db, actualGain: Db) => void;
|
22
|
+
constructor(norsk: Norsk, updates: RuntimeUpdates<AudioLevelState, AudioLevelCommand, AudioLevelEvent>, cfg: AudioLevelSettings);
|
23
|
+
initialise(): Promise<void>;
|
24
|
+
subscribe(sources: StudioComponentInputStream[]): Promise<void>;
|
25
|
+
}
|
26
|
+
export {};
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
|
7
|
+
const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
|
8
|
+
const path_1 = __importDefault(require("path"));
|
9
|
+
const schemas_1 = require("../shared/schemas");
|
10
|
+
class AudioLevelDefinition {
|
11
|
+
async schemas() {
|
12
|
+
return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), {
|
13
|
+
config: 'AudioLevelSettings',
|
14
|
+
state: 'AudioLevelState'
|
15
|
+
});
|
16
|
+
}
|
17
|
+
async create(norsk, cfg, cb, { updates }) {
|
18
|
+
const node = new AudioLevel(norsk, updates, cfg);
|
19
|
+
await node.initialised;
|
20
|
+
cb(node);
|
21
|
+
}
|
22
|
+
handleCommand(node, command) {
|
23
|
+
const commandType = command.type;
|
24
|
+
switch (commandType) {
|
25
|
+
case "set-gain": {
|
26
|
+
const newGain = mkNodeGain(command.value);
|
27
|
+
node.audioGain?.updateConfig({ channelGains: [newGain, newGain] });
|
28
|
+
node.sendSetGainEvent(command.value, newGain);
|
29
|
+
break;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
exports.default = AudioLevelDefinition;
|
35
|
+
function mkNodeGain(sliderGain) {
|
36
|
+
return (sliderGain || 0) - 40;
|
37
|
+
}
|
38
|
+
class AudioLevel extends base_nodes_1.CustomAutoDuplexNode {
|
39
|
+
initialised;
|
40
|
+
norsk;
|
41
|
+
updates;
|
42
|
+
cfg;
|
43
|
+
audioLevels;
|
44
|
+
audioGain;
|
45
|
+
sendSetGainEvent;
|
46
|
+
constructor(norsk, updates, cfg) {
|
47
|
+
super(cfg.id);
|
48
|
+
this.cfg = cfg;
|
49
|
+
this.norsk = norsk;
|
50
|
+
this.updates = updates;
|
51
|
+
this.initialised = this.initialise();
|
52
|
+
this.sendSetGainEvent = (sliderGain, nodeGain) => { updates.raiseEvent({ type: "set-gain", sliderGain: sliderGain ?? 0, nodeGain: nodeGain ?? 0 }); };
|
53
|
+
}
|
54
|
+
async initialise() {
|
55
|
+
const defaultGain = mkNodeGain(this.cfg.defaultGain);
|
56
|
+
const audioGain = await this.norsk.processor.transform.audioGain({
|
57
|
+
id: `${this.cfg.id}-audio-gain`,
|
58
|
+
channelGains: [defaultGain, defaultGain]
|
59
|
+
});
|
60
|
+
this.audioLevels = await this.norsk.processor.control.audioMeasureLevels({
|
61
|
+
id: `${this.cfg.id}-audiolevels`,
|
62
|
+
onData: (levels) => {
|
63
|
+
const total = levels.channelLevels.reduce((acc, l) => {
|
64
|
+
acc.peak += l.peak ?? 0;
|
65
|
+
acc.rms += l.rms ?? 0;
|
66
|
+
return acc;
|
67
|
+
}, { rms: 0, peak: 0 });
|
68
|
+
this.updates.raiseEvent({
|
69
|
+
type: 'audio-levels',
|
70
|
+
levels: {
|
71
|
+
peak: levels.channelLevels.length == 0 ? 0 : (total.peak / levels.channelLevels.length) ?? 0,
|
72
|
+
rms: levels.channelLevels.length == 0 ? 0 : (total.rms / levels.channelLevels.length) ?? 0
|
73
|
+
}
|
74
|
+
});
|
75
|
+
}
|
76
|
+
});
|
77
|
+
this.audioGain = audioGain;
|
78
|
+
this.audioLevels.subscribe([{ source: this.audioGain, sourceSelector: norsk_sdk_1.selectAudio }]);
|
79
|
+
this.updates.raiseEvent({ type: "set-gain", sliderGain: this.cfg.defaultGain ?? 0, nodeGain: (-40 + (this.cfg.defaultGain || 0)) ?? 0 });
|
80
|
+
this.setup({ input: audioGain, output: [audioGain] });
|
81
|
+
}
|
82
|
+
async subscribe(sources) {
|
83
|
+
this.audioGain?.subscribe(sources.map((s) => s.select()));
|
84
|
+
}
|
85
|
+
}
|
86
|
+
//# sourceMappingURL=runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.audioLevel/runtime.ts"],"names":[],"mappings":";;;;;AAAA,qDAA0H;AAG1H,kFAAyF;AACzF,gDAAwB;AAGxB,+CAAoD;AAOpD,MAAqB,oBAAoB;IACvC,KAAK,CAAC,OAAO;QACX,OAAO,IAAA,yBAAe,EAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE;YACzD,MAAM,EAAE,oBAAoB;YAC5B,KAAK,EAAE,iBAAiB;SACzB,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAuB,EAAE,EAAyB,EAAE,EAAE,OAAO,EAAsE;QAC5J,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACjD,MAAM,IAAI,CAAC,WAAW,CAAA;QACtB,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,aAAa,CAAC,IAAgB,EAAE,O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AC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;qBAC3F;iBACF,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,uBAAW,EAAE,CAAC,CAAC,CAAA;QACrF,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACxI,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IACvD,CAAC;IAEQ,KAAK,CAAC,SAAS,CAAC,OAAqC;QAC5D,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { AudioLevelState, AudioLevelSettings, AudioLevelCommand } from "./runtime";
|
2
|
+
declare function SummaryView({ state, sendCommand }: {
|
3
|
+
state: AudioLevelState;
|
4
|
+
config: AudioLevelSettings;
|
5
|
+
sendCommand: (cmd: AudioLevelCommand) => void;
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
7
|
+
export default SummaryView;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
const react_1 = require("react");
|
5
|
+
function SummaryView({ state, sendCommand }) {
|
6
|
+
const [sliderValue, setSliderValue] = (0, react_1.useState)(state.sliderGain || "0");
|
7
|
+
const [canSetVolume, setCanSetVolume] = (0, react_1.useState)(true);
|
8
|
+
const throttleDelay = 100;
|
9
|
+
function percentage(levels) {
|
10
|
+
if (!levels) {
|
11
|
+
return 0;
|
12
|
+
}
|
13
|
+
if (levels.peak == 0 && levels.rms == 0) {
|
14
|
+
return 0;
|
15
|
+
}
|
16
|
+
const rebase = levels.rms - 12.0;
|
17
|
+
const capped = 0 - (rebase / 112);
|
18
|
+
const snapped = Math.floor(capped * 10.0) * 10;
|
19
|
+
return Math.max(0, 100 - snapped);
|
20
|
+
}
|
21
|
+
const gainClasses = state.levels ? "col-start-2 self-end" : "col-start-1 col-end-3 self-end justify-self-start";
|
22
|
+
{ }
|
23
|
+
return (0, jsx_runtime_1.jsx)("div", { className: "processor-audioLevel", children: (0, jsx_runtime_1.jsxs)("div", { className: "audio-level-container grid mb-6 relative justify-items-center", children: [(0, jsx_runtime_1.jsxs)("div", { className: `preview-levels-summary ${state.levels ? "" : "opacity-30"}`, children: [(0, jsx_runtime_1.jsx)("div", { className: "relative w-full h-full", children: (0, jsx_runtime_1.jsx)("div", { className: `preview-level absolute h-full w-4/6 clip-${percentage(state.levels)}` }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm absolute -top-1", children: "0dB" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm absolute top-14", children: "-50dB" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm absolute -bottom-2", children: "-100dB" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-full flex items-center", children: (0, jsx_runtime_1.jsx)("input", { id: "audio-slider", className: `-rotate-90 h-2.5 ${state.levels ? "" : "opacity-20"}`, type: "range", name: "gain", min: "-40", max: "40", step: "1", defaultValue: state.sliderGain || "0", disabled: !state.levels, onChange: (e) => {
|
24
|
+
setSliderValue(e.target.value);
|
25
|
+
if (canSetVolume) {
|
26
|
+
setCanSetVolume(false);
|
27
|
+
sendCommand({ type: "set-gain", value: Number(e.target.value) });
|
28
|
+
setTimeout(() => {
|
29
|
+
setCanSetVolume(true);
|
30
|
+
}, throttleDelay);
|
31
|
+
}
|
32
|
+
}, onMouseUp: (_e) => {
|
33
|
+
sendCommand({ type: "set-gain", value: Number(sliderValue) });
|
34
|
+
} }) }), (0, jsx_runtime_1.jsx)("div", { className: gainClasses, children: state.levels ? "Gain:" : "No incoming audio" }), (0, jsx_runtime_1.jsx)("div", { className: "col-start-2", children: state.levels ? `${Number(sliderValue) > 0 ? "+" : ""} ${sliderValue} dB` : "" })] }) });
|
35
|
+
}
|
36
|
+
exports.default = SummaryView;
|
37
|
+
//# sourceMappingURL=summary-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"summary-view.js","sourceRoot":"","sources":["../../src/processor.audioLevel/summary-view.tsx"],"names":[],"mappings":";;;AAAA,iCAAiC;AAGjC,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,WAAW,EAAyG;IAChJ,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,UAAU,IAAI,GAAG,CAAC,CAAA;IACvE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAA;IACtD,MAAM,aAAa,GAAG,GAAG,CAAA;IACzB,SAAS,UAAU,CAAC,MAAkD;QACpE,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAC1B,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAG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AAG,EACrC,QAAQ,EAAE,CAAC,KAAK,CAAC,MAAM,EACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;4BACd,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;4BAC9B,IAAI,YAAY,EAAE,CAAC;gCACjB,eAAe,CAAC,KAAK,CAAC,CAAA;gCACtB,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;gCAChE,UAAU,CAAC,GAAG,EAAE;oCACd,eAAe,CAAC,IAAI,CAAC,CAAA;gCACvB,CAAC,EAAE,aAAa,CAAC,CAAA;4BACnB,CAAC;wBACH,CAAC,EACD,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;4BAChB,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;wBAC/D,CAAC,GAAI,GACH,EACN,gCAAK,SAAS,EAAE,WAAW,YACxB,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,GACzC,EACN,gCAAK,SAAS,EAAC,aAAa,YAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,WAAW,KAAK,CAAC,CAAC,CAAC,EAAE,GAAO,IAC9G,GACF,CAAA;AACR,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
export type paths = Record<string, never>;
|
2
|
+
export type webhooks = Record<string, never>;
|
3
|
+
export interface components {
|
4
|
+
schemas: {
|
5
|
+
AudioLevelSettings: {
|
6
|
+
id: string;
|
7
|
+
displayName: string;
|
8
|
+
defaultGain: number;
|
9
|
+
notes?: string;
|
10
|
+
};
|
11
|
+
AudioLevelState: {
|
12
|
+
levels?: {
|
13
|
+
peak: number;
|
14
|
+
rms: number;
|
15
|
+
};
|
16
|
+
sliderGain?: number;
|
17
|
+
nodeGain?: number;
|
18
|
+
};
|
19
|
+
AudioLevelEvent: {
|
20
|
+
type: "audio-levels";
|
21
|
+
levels: {
|
22
|
+
peak: number;
|
23
|
+
rms: number;
|
24
|
+
};
|
25
|
+
} | {
|
26
|
+
type: "set-gain";
|
27
|
+
sliderGain: number;
|
28
|
+
nodeGain: number;
|
29
|
+
};
|
30
|
+
AudioLevelCommand: {
|
31
|
+
type: "set-gain";
|
32
|
+
value: number;
|
33
|
+
};
|
34
|
+
};
|
35
|
+
responses: never;
|
36
|
+
parameters: never;
|
37
|
+
requestBodies: never;
|
38
|
+
headers: never;
|
39
|
+
pathItems: never;
|
40
|
+
}
|
41
|
+
export type $defs = Record<string, never>;
|
42
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/processor.audioLevel/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Audio Level
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
components:
|
7
|
+
schemas:
|
8
|
+
AudioLevelSettings:
|
9
|
+
type: object
|
10
|
+
properties:
|
11
|
+
id:
|
12
|
+
type: string
|
13
|
+
displayName:
|
14
|
+
type: string
|
15
|
+
defaultGain:
|
16
|
+
type: number
|
17
|
+
notes:
|
18
|
+
type: string
|
19
|
+
required:
|
20
|
+
- id
|
21
|
+
- displayName
|
22
|
+
- defaultGain
|
23
|
+
|
24
|
+
AudioLevelState:
|
25
|
+
type: object
|
26
|
+
properties:
|
27
|
+
levels:
|
28
|
+
type: object
|
29
|
+
properties:
|
30
|
+
peak:
|
31
|
+
type: number
|
32
|
+
rms:
|
33
|
+
type: number
|
34
|
+
required:
|
35
|
+
- peak
|
36
|
+
- rms
|
37
|
+
sliderGain:
|
38
|
+
type: number
|
39
|
+
nodeGain:
|
40
|
+
type: number
|
41
|
+
|
42
|
+
AudioLevelEvent:
|
43
|
+
oneOf:
|
44
|
+
- type: object
|
45
|
+
properties:
|
46
|
+
type:
|
47
|
+
const: 'audio-levels'
|
48
|
+
levels:
|
49
|
+
type: object
|
50
|
+
properties:
|
51
|
+
peak:
|
52
|
+
type: number
|
53
|
+
rms:
|
54
|
+
type: number
|
55
|
+
required:
|
56
|
+
- peak
|
57
|
+
- rms
|
58
|
+
required:
|
59
|
+
- type
|
60
|
+
- levels
|
61
|
+
- type: object
|
62
|
+
properties:
|
63
|
+
type:
|
64
|
+
const: 'set-gain'
|
65
|
+
sliderGain:
|
66
|
+
type: number
|
67
|
+
nodeGain:
|
68
|
+
type: number
|
69
|
+
required:
|
70
|
+
- type
|
71
|
+
- sliderGain
|
72
|
+
- nodeGain
|
73
|
+
|
74
|
+
AudioLevelCommand:
|
75
|
+
type: object
|
76
|
+
properties:
|
77
|
+
type:
|
78
|
+
const: 'set-gain'
|
79
|
+
value:
|
80
|
+
type: number
|
81
|
+
required:
|
82
|
+
- type
|
83
|
+
- value
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
2
|
+
export default function ({ defineComponent, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<{
|
3
|
+
id: string;
|
4
|
+
displayName: string;
|
5
|
+
systemInstruction: string;
|
6
|
+
api: "live" | "traditional";
|
7
|
+
notes?: string;
|
8
|
+
}, object, object, object>;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = default_1;
|
4
|
+
function default_1({ defineComponent, }) {
|
5
|
+
return defineComponent({
|
6
|
+
identifier: 'processor.gemini-poc',
|
7
|
+
category: 'processor',
|
8
|
+
name: "Gemini AI",
|
9
|
+
description: "This component is a proof-of-concept of integrating Google Gemini AI into Norsk workflows.",
|
10
|
+
subscription: {
|
11
|
+
accepts: {
|
12
|
+
type: 'simple-stream',
|
13
|
+
audio: true,
|
14
|
+
video: true
|
15
|
+
},
|
16
|
+
produces: {
|
17
|
+
type: 'simple-stream',
|
18
|
+
audio: true,
|
19
|
+
video: true
|
20
|
+
}
|
21
|
+
},
|
22
|
+
extraValidation: function (ctx) {
|
23
|
+
const video = ctx.videoInputs();
|
24
|
+
const audio = ctx.audioInputs();
|
25
|
+
if (video.length > 1) {
|
26
|
+
ctx.addError("Gemini AI cannot process multiple video streams");
|
27
|
+
}
|
28
|
+
if (audio.length > 1) {
|
29
|
+
ctx.addError("Gemini AI cannot process multiple audio streams");
|
30
|
+
}
|
31
|
+
},
|
32
|
+
display: (_desc) => {
|
33
|
+
return {};
|
34
|
+
},
|
35
|
+
configForm: {
|
36
|
+
form: {
|
37
|
+
systemInstruction: {
|
38
|
+
help: "The Gemini system instruction",
|
39
|
+
hint: {
|
40
|
+
type: 'text',
|
41
|
+
defaultValue: "You are a sports commentator. I will send you video from a soccer match, and you are to commentate on it. When you have commentary, call the test_response function with the text."
|
42
|
+
}
|
43
|
+
},
|
44
|
+
api: {
|
45
|
+
help: "Use the Live or Traditional Gemini API. Live is better for streaming, but traditional gives more accurate timing information on events",
|
46
|
+
hint: {
|
47
|
+
type: "select",
|
48
|
+
options: ["live", "traditional"].map((api) => { return { value: api, display: api }; }),
|
49
|
+
}
|
50
|
+
},
|
51
|
+
notes: {
|
52
|
+
help: "Notes about this component",
|
53
|
+
hint: { type: 'text', optional: true }
|
54
|
+
},
|
55
|
+
}
|
56
|
+
}
|
57
|
+
});
|
58
|
+
}
|
59
|
+
//# sourceMappingURL=info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.gemini-poc/info.ts"],"names":[],"mappings":";;AAIA,4BA6DC;AA7DD,mBAAwB,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