mulmocast 0.1.7 → 1.1.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/assets/templates/akira_comic.json +1 -1
- package/assets/templates/ani.json +1 -1
- package/assets/templates/ani_ja.json +2 -3
- package/assets/templates/characters.json +1 -1
- package/assets/templates/children_book.json +1 -1
- package/assets/templates/comic_strips.json +1 -1
- package/assets/templates/drslump_comic.json +1 -1
- package/assets/templates/ghibli_comic.json +1 -1
- package/assets/templates/ghibli_image_only.json +1 -1
- package/assets/templates/ghibli_shorts.json +2 -3
- package/assets/templates/ghost_comic.json +1 -1
- package/assets/templates/onepiece_comic.json +1 -1
- package/assets/templates/portrait_movie.json +1 -1
- package/assets/templates/realistic_movie.json +1 -1
- package/assets/templates/sensei_and_taro.json +4 -5
- package/assets/templates/shorts.json +1 -1
- package/assets/templates/trailer.json +1 -1
- package/lib/actions/audio.js +6 -7
- package/lib/actions/image_agents.d.ts +25 -76
- package/lib/actions/image_agents.js +11 -3
- package/lib/actions/images.js +36 -4
- package/lib/actions/movie.js +1 -1
- package/lib/agents/index.d.ts +2 -1
- package/lib/agents/index.js +2 -1
- package/lib/agents/movie_replicate_agent.js +17 -5
- package/lib/agents/sound_effect_replicate_agent.d.ts +5 -0
- package/lib/agents/sound_effect_replicate_agent.js +59 -0
- package/lib/mcp/server.js +2 -2
- package/lib/methods/index.d.ts +1 -0
- package/lib/methods/index.js +1 -0
- package/lib/methods/mulmo_presentation_style.d.ts +10 -5
- package/lib/methods/mulmo_presentation_style.js +24 -20
- package/lib/methods/mulmo_script.d.ts +4 -0
- package/lib/methods/mulmo_script.js +31 -0
- package/lib/types/agent.d.ts +9 -0
- package/lib/types/schema.d.ts +396 -244
- package/lib/types/schema.js +22 -12
- package/lib/types/type.d.ts +2 -3
- package/lib/utils/assets.d.ts +18 -0
- package/lib/utils/assets.js +101 -0
- package/lib/utils/context.d.ts +25 -12
- package/lib/utils/context.js +2 -1
- package/lib/utils/file.d.ts +4 -1
- package/lib/utils/file.js +3 -5
- package/lib/utils/preprocess.d.ts +20 -11
- package/lib/utils/preprocess.js +7 -5
- package/lib/utils/provider2agent.d.ts +19 -1
- package/lib/utils/provider2agent.js +73 -0
- package/lib/utils/utils.js +3 -0
- package/package.json +1 -1
package/lib/types/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { htmlLLMProvider, provider2TTSAgent, provider2ImageAgent, provider2MovieAgent, defaultProviders } from "../utils/provider2agent.js";
|
|
2
|
+
import { htmlLLMProvider, provider2TTSAgent, provider2ImageAgent, provider2MovieAgent, defaultProviders, provider2SoundEffectAgent, } from "../utils/provider2agent.js";
|
|
3
3
|
export const langSchema = z.string();
|
|
4
4
|
const URLStringSchema = z.string().url();
|
|
5
5
|
export const localizedTextSchema = z
|
|
@@ -26,6 +26,7 @@ export const speakerDataSchema = z
|
|
|
26
26
|
.object({
|
|
27
27
|
displayName: z.record(langSchema, z.string()).optional(),
|
|
28
28
|
voiceId: z.string(),
|
|
29
|
+
isDefault: z.boolean().optional(),
|
|
29
30
|
speechOptions: speechOptionsSchema.optional(),
|
|
30
31
|
provider: text2SpeechProviderSchema.optional(),
|
|
31
32
|
model: z.string().optional().describe("TTS model to use for this speaker"),
|
|
@@ -227,10 +228,14 @@ export const htmlPromptParamsSchema = z
|
|
|
227
228
|
})
|
|
228
229
|
.strict();
|
|
229
230
|
export const text2MovieProviderSchema = z.enum(Object.keys(provider2MovieAgent)).default(defaultProviders.text2movie);
|
|
230
|
-
const
|
|
231
|
+
export const text2SoundEffectProviderSchema = z.enum(Object.keys(provider2SoundEffectAgent)).default(defaultProviders.soundEffect);
|
|
232
|
+
export const mulmoSoundEffectParamsSchema = z.object({
|
|
233
|
+
provider: text2SoundEffectProviderSchema.optional(),
|
|
234
|
+
model: z.string().optional(), // default: provider specific
|
|
235
|
+
});
|
|
231
236
|
export const mulmoBeatSchema = z
|
|
232
237
|
.object({
|
|
233
|
-
speaker: speakerIdSchema.
|
|
238
|
+
speaker: speakerIdSchema.optional(),
|
|
234
239
|
text: z.string().default("").describe("Text to be spoken. If empty, the audio is not generated."),
|
|
235
240
|
id: z.string().optional().describe("Unique identifier for the beat."),
|
|
236
241
|
description: z.string().optional(),
|
|
@@ -247,6 +252,7 @@ export const mulmoBeatSchema = z
|
|
|
247
252
|
speed: z.number().optional().describe("Speed of the video. 1.0 is normal speed. 0.5 is half speed. 2.0 is double speed."), // for movie.ts
|
|
248
253
|
})
|
|
249
254
|
.optional(),
|
|
255
|
+
soundEffectParams: mulmoSoundEffectParamsSchema.optional(),
|
|
250
256
|
htmlImageParams: mulmoHtmlImageParamsSchema.optional(),
|
|
251
257
|
speechOptions: speechOptionsSchema.optional(),
|
|
252
258
|
textSlideParams: textSlideParamsSchema.optional(),
|
|
@@ -254,6 +260,7 @@ export const mulmoBeatSchema = z
|
|
|
254
260
|
imageNames: z.array(imageIdSchema).optional(), // list of image names to use for image generation. The default is all images in the imageParams.images.
|
|
255
261
|
imagePrompt: z.string().optional(),
|
|
256
262
|
moviePrompt: z.string().optional(),
|
|
263
|
+
soundEffectPrompt: z.string().optional(),
|
|
257
264
|
htmlPrompt: htmlPromptParamsSchema.optional(),
|
|
258
265
|
})
|
|
259
266
|
.strict();
|
|
@@ -266,17 +273,10 @@ export const mulmoCanvasDimensionSchema = z
|
|
|
266
273
|
// export const voiceMapSchema = z.record(speakerIdSchema, z.string())
|
|
267
274
|
export const mulmoCastCreditSchema = z
|
|
268
275
|
.object({
|
|
269
|
-
version: z.literal("1.
|
|
276
|
+
version: z.literal("1.1"),
|
|
270
277
|
credit: z.literal("closing").optional(),
|
|
271
278
|
})
|
|
272
279
|
.strict();
|
|
273
|
-
export const mulmoSpeechParamsSchema = z
|
|
274
|
-
.object({
|
|
275
|
-
provider: text2SpeechProviderSchema, // has default value
|
|
276
|
-
speakers: speakerDictionarySchema,
|
|
277
|
-
model: z.string().optional().describe("Default TTS model to use"),
|
|
278
|
-
})
|
|
279
|
-
.strict();
|
|
280
280
|
export const text2HtmlImageProviderSchema = z.enum(htmlLLMProvider).default(defaultProviders.text2Html);
|
|
281
281
|
// NOTE: This is UI only. (until we figure out how to use it in mulmoMovieParamsSchema)
|
|
282
282
|
export const mulmoGoogleMovieModelSchema = z
|
|
@@ -304,10 +304,15 @@ export const mulmoMovieParamsSchema = z
|
|
|
304
304
|
fillOption: mulmoFillOptionSchema.optional(), // for movie.ts
|
|
305
305
|
})
|
|
306
306
|
.strict();
|
|
307
|
+
const defaultSpeaker = "Presenter";
|
|
307
308
|
export const mulmoPresentationStyleSchema = z.object({
|
|
308
309
|
$mulmocast: mulmoCastCreditSchema,
|
|
309
310
|
canvasSize: mulmoCanvasDimensionSchema, // has default value
|
|
310
|
-
speechParams:
|
|
311
|
+
speechParams: z
|
|
312
|
+
.object({
|
|
313
|
+
speakers: speakerDictionarySchema,
|
|
314
|
+
})
|
|
315
|
+
.default({
|
|
311
316
|
speakers: {
|
|
312
317
|
[defaultSpeaker]: {
|
|
313
318
|
voiceId: "shimmer",
|
|
@@ -324,6 +329,9 @@ export const mulmoPresentationStyleSchema = z.object({
|
|
|
324
329
|
movieParams: mulmoMovieParamsSchema.optional().default({
|
|
325
330
|
provider: defaultProviders.text2movie,
|
|
326
331
|
}),
|
|
332
|
+
soundEffectParams: mulmoSoundEffectParamsSchema.optional().default({
|
|
333
|
+
provider: defaultProviders.soundEffect,
|
|
334
|
+
}),
|
|
327
335
|
htmlImageParams: mulmoHtmlImageParamsSchema
|
|
328
336
|
.extend({
|
|
329
337
|
provider: text2HtmlImageProviderSchema,
|
|
@@ -372,6 +380,7 @@ export const mulmoStudioBeatSchema = z
|
|
|
372
380
|
audioFile: z.string().optional(),
|
|
373
381
|
imageFile: z.string().optional(), // path to the image
|
|
374
382
|
movieFile: z.string().optional(), // path to the movie file
|
|
383
|
+
soundEffectFile: z.string().optional(), // path to the sound effect file
|
|
375
384
|
captionFile: z.string().optional(), // path to the caption image
|
|
376
385
|
})
|
|
377
386
|
.strict();
|
|
@@ -396,6 +405,7 @@ export const mulmoSessionStateSchema = z.object({
|
|
|
396
405
|
caption: z.record(z.number().int(), z.boolean()),
|
|
397
406
|
html: z.record(z.number().int(), z.boolean()),
|
|
398
407
|
imageReference: z.record(z.number().int(), z.boolean()),
|
|
408
|
+
soundEffect: z.record(z.number().int(), z.boolean()),
|
|
399
409
|
}),
|
|
400
410
|
});
|
|
401
411
|
export const mulmoStudioSchema = z
|
package/lib/types/type.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema,
|
|
1
|
+
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoScriptTemplateSchema, mulmoScriptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoImageAssetSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema, mulmoGoogleMovieModelSchema, mulmoReplicateMovieModelSchema, mulmoImagePromptMediaSchema } from "./schema.js";
|
|
2
2
|
import { pdf_modes, pdf_sizes, storyToScriptGenerateMode } from "../utils/const.js";
|
|
3
3
|
import type { LLM } from "../utils/provider2agent.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
export type LANG = z.infer<typeof langSchema>;
|
|
6
6
|
export type MulmoBeat = z.infer<typeof mulmoBeatSchema>;
|
|
7
7
|
export type SpeakerDictonary = z.infer<typeof speakerDictionarySchema>;
|
|
8
|
-
export type MulmoSpeechParams = z.infer<typeof mulmoSpeechParamsSchema>;
|
|
9
8
|
export type SpeechOptions = z.infer<typeof speechOptionsSchema>;
|
|
10
9
|
export type SpeakerData = z.infer<typeof speakerDataSchema>;
|
|
11
10
|
export type MulmoImageParams = z.infer<typeof mulmoImageParamsSchema>;
|
|
@@ -92,7 +91,7 @@ export type Text2HtmlAgentInfo = {
|
|
|
92
91
|
export type BeatMediaType = "movie" | "image";
|
|
93
92
|
export type StoryToScriptGenerateMode = (typeof storyToScriptGenerateMode)[keyof typeof storyToScriptGenerateMode];
|
|
94
93
|
export type SessionType = "audio" | "image" | "video" | "multiLingual" | "caption" | "pdf";
|
|
95
|
-
export type BeatSessionType = "audio" | "image" | "multiLingual" | "caption" | "movie" | "html" | "imageReference";
|
|
94
|
+
export type BeatSessionType = "audio" | "image" | "multiLingual" | "caption" | "movie" | "html" | "imageReference" | "soundEffect";
|
|
96
95
|
export type SessionProgressEvent = {
|
|
97
96
|
kind: "session";
|
|
98
97
|
sessionType: SessionType;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type BgmAsset = {
|
|
2
|
+
name: string;
|
|
3
|
+
title: string;
|
|
4
|
+
url: string;
|
|
5
|
+
suno_url: string;
|
|
6
|
+
date: string;
|
|
7
|
+
duration: string;
|
|
8
|
+
account: string;
|
|
9
|
+
original_license: string;
|
|
10
|
+
prompt: string;
|
|
11
|
+
model: string;
|
|
12
|
+
};
|
|
13
|
+
export type BgmAssets = {
|
|
14
|
+
license: string;
|
|
15
|
+
bgms: BgmAsset[];
|
|
16
|
+
};
|
|
17
|
+
export declare const bgmAssets: BgmAssets;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export const bgmAssets = {
|
|
2
|
+
license: "Free to distribute as the BMG of media generated by MulmoCast, including commercial use.",
|
|
3
|
+
bgms: [
|
|
4
|
+
{
|
|
5
|
+
name: "story001.mp3",
|
|
6
|
+
title: "Whispered Melody",
|
|
7
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story001.mp3",
|
|
8
|
+
suno_url: "https://suno.com/s/v6zer50aQJu8Y0qA",
|
|
9
|
+
date: "2025-06-17",
|
|
10
|
+
duration: "03:17",
|
|
11
|
+
account: "@snakajima",
|
|
12
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
13
|
+
prompt: "instrumental, smooth, piano",
|
|
14
|
+
model: "v4.5 beta",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "story002.mp3",
|
|
18
|
+
title: "Rise and Shine",
|
|
19
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story002.mp3",
|
|
20
|
+
suno_url: "https://suno.com/s/mJnvyu3UXnkdAPfQ",
|
|
21
|
+
date: "2025-06-17",
|
|
22
|
+
duration: "04:04",
|
|
23
|
+
account: "@snakajima",
|
|
24
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
25
|
+
prompt: "techno, inspiring, piano",
|
|
26
|
+
model: "v4.5 beta",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "story003.mp3",
|
|
30
|
+
title: "Chasing the Sunset",
|
|
31
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story003.mp3",
|
|
32
|
+
suno_url: "https://suno.com/s/2zGjMQ9vURJbaMZA",
|
|
33
|
+
date: "2025-06-17",
|
|
34
|
+
duration: "02:49",
|
|
35
|
+
account: "@snakajima",
|
|
36
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
37
|
+
prompt: "piano, inspiring, sunset",
|
|
38
|
+
model: "v4.5 beta",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "story004.mp3",
|
|
42
|
+
title: "Whispering Keys",
|
|
43
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story004.mp3",
|
|
44
|
+
suno_url: "https://suno.com/s/0SFoBRsBWsncw6tu",
|
|
45
|
+
date: "2025-06-17",
|
|
46
|
+
duration: "04:00",
|
|
47
|
+
account: "@snakajima",
|
|
48
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
49
|
+
prompt: "Piano, classical, ambient",
|
|
50
|
+
model: "v4",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "story005.mp3",
|
|
54
|
+
title: "Whisper of Ivory",
|
|
55
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story005.mp3",
|
|
56
|
+
suno_url: "https://suno.com/s/0SFoBRsBWsncw6tu",
|
|
57
|
+
date: "2025-06-17",
|
|
58
|
+
duration: "04:00",
|
|
59
|
+
account: "@snakajima",
|
|
60
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
61
|
+
prompt: "Piano solo, classical, ambient",
|
|
62
|
+
model: "v4",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "theme001.mp3",
|
|
66
|
+
title: "Rise of the Flame",
|
|
67
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/theme001.mp3",
|
|
68
|
+
suno_url: "https://suno.com/s/WhYOf8oJYhBgSKET",
|
|
69
|
+
date: "2025-06-20",
|
|
70
|
+
duration: "03:23",
|
|
71
|
+
account: "@snakajima",
|
|
72
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
73
|
+
prompt: "Olympic Theme, classical, emotional",
|
|
74
|
+
model: "v4",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "olympic001.mp3",
|
|
78
|
+
title: "Olympic-style Theme Music",
|
|
79
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/olympic001.mp3",
|
|
80
|
+
suno_url: "https://suno.com/s/32wpnmCrkFVvkTSQ",
|
|
81
|
+
date: "2025-07-17",
|
|
82
|
+
duration: "02:54",
|
|
83
|
+
account: "@snakajima",
|
|
84
|
+
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
85
|
+
prompt: "Epic orchestral fanfare in the style of John Williams' Olympic Fanfare and Theme. Bright brass fanfare, soaring strings, powerful percussion, and heroic French horn melodies. Triumphant and majestic mood, suitable for an opening ceremony or national celebration. Emphasize dynamic builds, rich harmonies, and cinematic grandeur.",
|
|
86
|
+
model: "v4.5+",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "morning001.mp3",
|
|
90
|
+
title: "Morning Dance",
|
|
91
|
+
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/morning001.mp3",
|
|
92
|
+
suno_url: "https://suno.com/s/9MTkutZYqxeyBlwK",
|
|
93
|
+
date: "2025-07-17",
|
|
94
|
+
duration: "03:52",
|
|
95
|
+
account: "@snakajima",
|
|
96
|
+
original_license: "morning, piano solo, Japanese name, sexy",
|
|
97
|
+
prompt: "morning, piano solo, Japanese name, sexy",
|
|
98
|
+
model: "v4.5+",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
package/lib/utils/context.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
16
16
|
audioFile?: string | undefined;
|
|
17
17
|
imageFile?: string | undefined;
|
|
18
18
|
movieFile?: string | undefined;
|
|
19
|
+
soundEffectFile?: string | undefined;
|
|
19
20
|
captionFile?: string | undefined;
|
|
20
21
|
}[];
|
|
21
22
|
script: {
|
|
@@ -77,8 +78,12 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
77
78
|
duration: number;
|
|
78
79
|
} | undefined;
|
|
79
80
|
};
|
|
81
|
+
soundEffectParams: {
|
|
82
|
+
provider?: string | undefined;
|
|
83
|
+
model?: string | undefined;
|
|
84
|
+
};
|
|
80
85
|
$mulmocast: {
|
|
81
|
-
version: "1.
|
|
86
|
+
version: "1.1";
|
|
82
87
|
credit?: "closing" | undefined;
|
|
83
88
|
};
|
|
84
89
|
canvasSize: {
|
|
@@ -86,10 +91,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
86
91
|
height: number;
|
|
87
92
|
};
|
|
88
93
|
speechParams: {
|
|
89
|
-
provider: string;
|
|
90
94
|
speakers: Record<string, {
|
|
91
95
|
voiceId: string;
|
|
92
96
|
displayName?: Record<string, string> | undefined;
|
|
97
|
+
isDefault?: boolean | undefined;
|
|
93
98
|
speechOptions?: {
|
|
94
99
|
speed?: number | undefined;
|
|
95
100
|
instruction?: string | undefined;
|
|
@@ -97,16 +102,9 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
97
102
|
provider?: string | undefined;
|
|
98
103
|
model?: string | undefined;
|
|
99
104
|
}>;
|
|
100
|
-
model?: string | undefined;
|
|
101
105
|
};
|
|
102
106
|
beats: {
|
|
103
107
|
text: string;
|
|
104
|
-
speaker: string;
|
|
105
|
-
duration?: number | undefined;
|
|
106
|
-
speechOptions?: {
|
|
107
|
-
speed?: number | undefined;
|
|
108
|
-
instruction?: string | undefined;
|
|
109
|
-
} | undefined;
|
|
110
108
|
image?: {
|
|
111
109
|
type: "markdown";
|
|
112
110
|
markdown: string | string[];
|
|
@@ -211,6 +209,11 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
211
209
|
type: "voice_over";
|
|
212
210
|
startAt?: number | undefined;
|
|
213
211
|
} | undefined;
|
|
212
|
+
duration?: number | undefined;
|
|
213
|
+
speechOptions?: {
|
|
214
|
+
speed?: number | undefined;
|
|
215
|
+
instruction?: string | undefined;
|
|
216
|
+
} | undefined;
|
|
214
217
|
id?: string | undefined;
|
|
215
218
|
audio?: {
|
|
216
219
|
type: "audio";
|
|
@@ -232,6 +235,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
232
235
|
source: string;
|
|
233
236
|
} | undefined;
|
|
234
237
|
imagePrompt?: string | undefined;
|
|
238
|
+
speaker?: string | undefined;
|
|
235
239
|
description?: string | undefined;
|
|
236
240
|
imageParams?: {
|
|
237
241
|
provider: string;
|
|
@@ -270,6 +274,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
270
274
|
style: "aspectFit" | "aspectFill";
|
|
271
275
|
} | undefined;
|
|
272
276
|
} | undefined;
|
|
277
|
+
soundEffectParams?: {
|
|
278
|
+
provider?: string | undefined;
|
|
279
|
+
model?: string | undefined;
|
|
280
|
+
} | undefined;
|
|
273
281
|
htmlImageParams?: {
|
|
274
282
|
model?: string | undefined;
|
|
275
283
|
} | undefined;
|
|
@@ -282,6 +290,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
282
290
|
} | undefined;
|
|
283
291
|
imageNames?: string[] | undefined;
|
|
284
292
|
moviePrompt?: string | undefined;
|
|
293
|
+
soundEffectPrompt?: string | undefined;
|
|
285
294
|
htmlPrompt?: {
|
|
286
295
|
prompt: string;
|
|
287
296
|
data?: any;
|
|
@@ -334,6 +343,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
334
343
|
caption: {};
|
|
335
344
|
html: {};
|
|
336
345
|
imageReference: {};
|
|
346
|
+
soundEffect: {};
|
|
337
347
|
};
|
|
338
348
|
};
|
|
339
349
|
presentationStyle: {
|
|
@@ -395,8 +405,12 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
395
405
|
duration: number;
|
|
396
406
|
} | undefined;
|
|
397
407
|
};
|
|
408
|
+
soundEffectParams: {
|
|
409
|
+
provider?: string | undefined;
|
|
410
|
+
model?: string | undefined;
|
|
411
|
+
};
|
|
398
412
|
$mulmocast: {
|
|
399
|
-
version: "1.
|
|
413
|
+
version: "1.1";
|
|
400
414
|
credit?: "closing" | undefined;
|
|
401
415
|
};
|
|
402
416
|
canvasSize: {
|
|
@@ -404,10 +418,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
404
418
|
height: number;
|
|
405
419
|
};
|
|
406
420
|
speechParams: {
|
|
407
|
-
provider: string;
|
|
408
421
|
speakers: Record<string, {
|
|
409
422
|
voiceId: string;
|
|
410
423
|
displayName?: Record<string, string> | undefined;
|
|
424
|
+
isDefault?: boolean | undefined;
|
|
411
425
|
speechOptions?: {
|
|
412
426
|
speed?: number | undefined;
|
|
413
427
|
instruction?: string | undefined;
|
|
@@ -415,7 +429,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
415
429
|
provider?: string | undefined;
|
|
416
430
|
model?: string | undefined;
|
|
417
431
|
}>;
|
|
418
|
-
model?: string | undefined;
|
|
419
432
|
};
|
|
420
433
|
htmlImageParams?: {
|
|
421
434
|
provider: string;
|
package/lib/utils/context.js
CHANGED
|
@@ -58,6 +58,7 @@ const initSessionState = () => {
|
|
|
58
58
|
caption: {},
|
|
59
59
|
html: {},
|
|
60
60
|
imageReference: {},
|
|
61
|
+
soundEffect: {},
|
|
61
62
|
},
|
|
62
63
|
};
|
|
63
64
|
};
|
|
@@ -84,7 +85,7 @@ export const initializeContextFromFiles = async (files, raiseError, force, capti
|
|
|
84
85
|
const currentStudio = readMulmoScriptFile(outputStudioFilePath);
|
|
85
86
|
try {
|
|
86
87
|
// validate mulmoStudioSchema. skip if __test_invalid__ is true
|
|
87
|
-
const studio = createOrUpdateStudioData(mulmoScript, currentStudio?.mulmoData, fileName, caption);
|
|
88
|
+
const studio = createOrUpdateStudioData(mulmoScript, currentStudio?.mulmoData, fileName, caption, presentationStyle);
|
|
88
89
|
const multiLingual = getMultiLingual(outputMultilingualFilePath, studio.beats.length);
|
|
89
90
|
return buildContext(studio, files, presentationStyle, multiLingual, force, lang);
|
|
90
91
|
}
|
package/lib/utils/file.d.ts
CHANGED
|
@@ -25,7 +25,10 @@ export declare const getAudioArtifactFilePath: (outDirPath: string, fileName: st
|
|
|
25
25
|
export declare const getOutputVideoFilePath: (outDirPath: string, fileName: string, lang?: string, caption?: string) => string;
|
|
26
26
|
export declare const imageSuffix = "p";
|
|
27
27
|
export declare const getBeatPngImagePath: (context: MulmoStudioContext, index: number) => string;
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const getBeatMoviePaths: (context: MulmoStudioContext, index: number) => {
|
|
29
|
+
movieFile: string;
|
|
30
|
+
soundEffectFile: string;
|
|
31
|
+
};
|
|
29
32
|
export declare const getReferenceImagePath: (context: MulmoStudioContext, key: string, extension: string) => string;
|
|
30
33
|
export declare const getCaptionImagePath: (context: MulmoStudioContext, index: number) => string;
|
|
31
34
|
export declare const getOutputPdfFilePath: (outDirPath: string, fileName: string, pdfMode: PDFMode, lang?: string) => string;
|
package/lib/utils/file.js
CHANGED
|
@@ -87,13 +87,11 @@ export const getBeatPngImagePath = (context, index) => {
|
|
|
87
87
|
}
|
|
88
88
|
return `${imageProjectDirPath}/${index}${imageSuffix}.png`;
|
|
89
89
|
};
|
|
90
|
-
export const
|
|
90
|
+
export const getBeatMoviePaths = (context, index) => {
|
|
91
91
|
const imageProjectDirPath = MulmoStudioContextMethods.getImageProjectDirPath(context);
|
|
92
92
|
const beat = context.studio.script.beats[index]; // beat could be undefined only in a test case.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
return `${imageProjectDirPath}/${index}.mov`;
|
|
93
|
+
const filename = beat?.id ? `${beat.id}` : `${index}`;
|
|
94
|
+
return { movieFile: `${imageProjectDirPath}/${filename}.mov`, soundEffectFile: `${imageProjectDirPath}/${filename}_sound.mov` };
|
|
97
95
|
};
|
|
98
96
|
export const getReferenceImagePath = (context, key, extension) => {
|
|
99
97
|
const imageProjectDirPath = MulmoStudioContextMethods.getImageProjectDirPath(context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MulmoStudio, MulmoScript } from "../types/index.js";
|
|
2
|
-
export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, currentStudio: MulmoStudio | undefined, fileName: string, videoCaption?: string) => {
|
|
1
|
+
import { MulmoStudio, MulmoScript, MulmoPresentationStyle } from "../types/index.js";
|
|
2
|
+
export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, currentStudio: MulmoStudio | undefined, fileName: string, videoCaption?: string, presentationStyle?: MulmoPresentationStyle | null) => {
|
|
3
3
|
beats: {
|
|
4
4
|
duration?: number | undefined;
|
|
5
5
|
startAt?: number | undefined;
|
|
@@ -11,6 +11,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
11
11
|
audioFile?: string | undefined;
|
|
12
12
|
imageFile?: string | undefined;
|
|
13
13
|
movieFile?: string | undefined;
|
|
14
|
+
soundEffectFile?: string | undefined;
|
|
14
15
|
captionFile?: string | undefined;
|
|
15
16
|
}[];
|
|
16
17
|
script: {
|
|
@@ -72,8 +73,12 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
72
73
|
duration: number;
|
|
73
74
|
} | undefined;
|
|
74
75
|
};
|
|
76
|
+
soundEffectParams: {
|
|
77
|
+
provider?: string | undefined;
|
|
78
|
+
model?: string | undefined;
|
|
79
|
+
};
|
|
75
80
|
$mulmocast: {
|
|
76
|
-
version: "1.
|
|
81
|
+
version: "1.1";
|
|
77
82
|
credit?: "closing" | undefined;
|
|
78
83
|
};
|
|
79
84
|
canvasSize: {
|
|
@@ -81,10 +86,10 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
81
86
|
height: number;
|
|
82
87
|
};
|
|
83
88
|
speechParams: {
|
|
84
|
-
provider: string;
|
|
85
89
|
speakers: Record<string, {
|
|
86
90
|
voiceId: string;
|
|
87
91
|
displayName?: Record<string, string> | undefined;
|
|
92
|
+
isDefault?: boolean | undefined;
|
|
88
93
|
speechOptions?: {
|
|
89
94
|
speed?: number | undefined;
|
|
90
95
|
instruction?: string | undefined;
|
|
@@ -92,16 +97,9 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
92
97
|
provider?: string | undefined;
|
|
93
98
|
model?: string | undefined;
|
|
94
99
|
}>;
|
|
95
|
-
model?: string | undefined;
|
|
96
100
|
};
|
|
97
101
|
beats: {
|
|
98
102
|
text: string;
|
|
99
|
-
speaker: string;
|
|
100
|
-
duration?: number | undefined;
|
|
101
|
-
speechOptions?: {
|
|
102
|
-
speed?: number | undefined;
|
|
103
|
-
instruction?: string | undefined;
|
|
104
|
-
} | undefined;
|
|
105
103
|
image?: {
|
|
106
104
|
type: "markdown";
|
|
107
105
|
markdown: string | string[];
|
|
@@ -206,6 +204,11 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
206
204
|
type: "voice_over";
|
|
207
205
|
startAt?: number | undefined;
|
|
208
206
|
} | undefined;
|
|
207
|
+
duration?: number | undefined;
|
|
208
|
+
speechOptions?: {
|
|
209
|
+
speed?: number | undefined;
|
|
210
|
+
instruction?: string | undefined;
|
|
211
|
+
} | undefined;
|
|
209
212
|
id?: string | undefined;
|
|
210
213
|
audio?: {
|
|
211
214
|
type: "audio";
|
|
@@ -227,6 +230,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
227
230
|
source: string;
|
|
228
231
|
} | undefined;
|
|
229
232
|
imagePrompt?: string | undefined;
|
|
233
|
+
speaker?: string | undefined;
|
|
230
234
|
description?: string | undefined;
|
|
231
235
|
imageParams?: {
|
|
232
236
|
provider: string;
|
|
@@ -265,6 +269,10 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
265
269
|
style: "aspectFit" | "aspectFill";
|
|
266
270
|
} | undefined;
|
|
267
271
|
} | undefined;
|
|
272
|
+
soundEffectParams?: {
|
|
273
|
+
provider?: string | undefined;
|
|
274
|
+
model?: string | undefined;
|
|
275
|
+
} | undefined;
|
|
268
276
|
htmlImageParams?: {
|
|
269
277
|
model?: string | undefined;
|
|
270
278
|
} | undefined;
|
|
@@ -277,6 +285,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
277
285
|
} | undefined;
|
|
278
286
|
imageNames?: string[] | undefined;
|
|
279
287
|
moviePrompt?: string | undefined;
|
|
288
|
+
soundEffectPrompt?: string | undefined;
|
|
280
289
|
htmlPrompt?: {
|
|
281
290
|
prompt: string;
|
|
282
291
|
data?: any;
|
package/lib/utils/preprocess.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GraphAILogger } from "graphai";
|
|
2
|
-
import {
|
|
2
|
+
import { mulmoStudioSchema, mulmoCaptionParamsSchema } from "../types/index.js";
|
|
3
|
+
import { MulmoPresentationStyleMethods, MulmoScriptMethods } from "../methods/index.js";
|
|
3
4
|
const rebuildStudio = (currentStudio, mulmoScript, fileName) => {
|
|
4
5
|
const isTest = process.env.NODE_ENV === "test";
|
|
5
6
|
const parsed = isTest && currentStudio ? { data: mulmoStudioSchema.parse(currentStudio), success: true, error: null } : mulmoStudioSchema.safeParse(currentStudio);
|
|
@@ -36,15 +37,16 @@ const mulmoCredit = (speaker) => {
|
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
export const createOrUpdateStudioData = (_mulmoScript, currentStudio, fileName, videoCaption) => {
|
|
40
|
-
const mulmoScript = _mulmoScript.__test_invalid__ ? _mulmoScript :
|
|
40
|
+
export const createOrUpdateStudioData = (_mulmoScript, currentStudio, fileName, videoCaption, presentationStyle) => {
|
|
41
|
+
const mulmoScript = _mulmoScript.__test_invalid__ ? _mulmoScript : MulmoScriptMethods.validate(_mulmoScript); // validate and insert default value
|
|
41
42
|
const studio = rebuildStudio(currentStudio, mulmoScript, fileName);
|
|
42
43
|
// TODO: Move this code out of this function later
|
|
43
44
|
// Addition cloing credit
|
|
44
45
|
if (mulmoScript.$mulmocast.credit === "closing") {
|
|
45
|
-
|
|
46
|
+
const defaultSpeaker = MulmoPresentationStyleMethods.getDefaultSpeaker(presentationStyle ?? studio.script);
|
|
47
|
+
mulmoScript.beats.push(mulmoCredit(mulmoScript.beats[0].speaker ?? defaultSpeaker)); // First speaker
|
|
46
48
|
}
|
|
47
|
-
studio.script =
|
|
49
|
+
studio.script = MulmoScriptMethods.validate(mulmoScript); // update the script
|
|
48
50
|
studio.beats = studio.script.beats.map((_, index) => studio.beats[index] ?? {});
|
|
49
51
|
if (videoCaption) {
|
|
50
52
|
studio.script.captionParams = mulmoCaptionParamsSchema.parse({
|
|
@@ -32,11 +32,18 @@ export declare const provider2ImageAgent: {
|
|
|
32
32
|
models: string[];
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
+
export type ReplicateModel = `${string}/${string}`;
|
|
35
36
|
export declare const provider2MovieAgent: {
|
|
36
37
|
replicate: {
|
|
37
38
|
agentName: string;
|
|
38
|
-
defaultModel:
|
|
39
|
+
defaultModel: ReplicateModel;
|
|
39
40
|
models: string[];
|
|
41
|
+
modelParams: Record<ReplicateModel, {
|
|
42
|
+
durations: number[];
|
|
43
|
+
start_image: string | undefined;
|
|
44
|
+
last_image?: string;
|
|
45
|
+
price_per_sec: number;
|
|
46
|
+
}>;
|
|
40
47
|
};
|
|
41
48
|
google: {
|
|
42
49
|
agentName: string;
|
|
@@ -44,6 +51,16 @@ export declare const provider2MovieAgent: {
|
|
|
44
51
|
models: string[];
|
|
45
52
|
};
|
|
46
53
|
};
|
|
54
|
+
export declare const provider2SoundEffectAgent: {
|
|
55
|
+
replicate: {
|
|
56
|
+
agentName: string;
|
|
57
|
+
defaultModel: ReplicateModel;
|
|
58
|
+
models: ReplicateModel[];
|
|
59
|
+
modelParams: Record<ReplicateModel, {
|
|
60
|
+
identifier?: `${string}/${string}:${string}`;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
47
64
|
export declare const provider2LLMAgent: {
|
|
48
65
|
readonly openai: {
|
|
49
66
|
readonly agentName: "openAIAgent";
|
|
@@ -72,6 +89,7 @@ export declare const defaultProviders: {
|
|
|
72
89
|
text2movie: keyof typeof provider2MovieAgent;
|
|
73
90
|
text2Html: keyof typeof provider2LLMAgent;
|
|
74
91
|
llm: keyof typeof provider2LLMAgent;
|
|
92
|
+
soundEffect: keyof typeof provider2SoundEffectAgent;
|
|
75
93
|
};
|
|
76
94
|
export declare const llm: (keyof typeof provider2LLMAgent)[];
|
|
77
95
|
export type LLM = keyof typeof provider2LLMAgent;
|