sonilo 0.11.2 → 0.13.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.d.cts CHANGED
@@ -100,8 +100,9 @@ interface VideoToMusicParams {
100
100
  * finalize-time transcodes and require async. Defaults to m4a. */
101
101
  outputFormat?: "m4a" | "wav" | "mp3";
102
102
  /** Duck the generated music under the source voice at finalize time.
103
- * Default-ON server-side in async mode: leave unset to keep it on, pass
104
- * `false` to opt out. Free, best-effort; only valid on `submit()`. */
103
+ * Default-OFF server-side: leave unset to skip it, pass `true` to run it,
104
+ * which adds a `ducked` track alongside the unchanged clean `audio`. Free,
105
+ * best-effort; only valid on `submit()`. */
105
106
  ducking?: boolean;
106
107
  /** How many distinct music variants to generate in one request (1-10,
107
108
  * default 1). Cost scales linearly, and values above 1 are never covered
@@ -109,6 +110,14 @@ interface VideoToMusicParams {
109
110
  * by `submit()`) — only meaningful via `submit()`; `stream()`/`generate()`
110
111
  * never send it, since they always request a plain stream. */
111
112
  variantsNum?: number;
113
+ /** How strongly the generated music follows the prompt (0-1, API default
114
+ * 0.5). Lower values let the video lead; higher values follow the prompt
115
+ * more literally. Free of charge. A generation-time knob, not a
116
+ * finalize-time one, so it works on the plain stream as well as async —
117
+ * no `mode` gating. Omitted from the wire when unset so the server
118
+ * default applies; `0` is a meaningful value and is sent. Out-of-range
119
+ * values are rejected server-side with a 422. */
120
+ promptInfluence?: number;
112
121
  }
113
122
  /** One service's free-trial allowance. `remaining` is already floored at 0,
114
123
  * so it is safe to compare directly. */
@@ -282,10 +291,10 @@ interface VideoResult extends BaseTaskResult {
282
291
  * | Request | Audio in the returned video |
283
292
  * | --- | --- |
284
293
  * | neither set | generated music only — the source's own audio is removed |
285
- * | `keepOriginalSound: true` | full original sound + music ducked under it |
286
- * | `keepOriginalSound: true, ducking: false` | full original sound + static music mix |
287
- * | `preserveSpeech: true` | isolated vocals + music ducked under them |
288
- * | `preserveSpeech: true, ducking: false` | static vocal-forward mix of vocals + music |
294
+ * | `keepOriginalSound: true` | full original sound + static music mix |
295
+ * | `keepOriginalSound: true, ducking: true` | full original sound + music ducked under it |
296
+ * | `preserveSpeech: true` | static vocal-forward mix of vocals + music |
297
+ * | `preserveSpeech: true, ducking: true` | isolated vocals + music ducked under them |
289
298
  *
290
299
  * `keepOriginalSound` supersedes `preserveSpeech` — the voice source is a
291
300
  * single choice, and keeping the whole track subsumes keeping only the
@@ -309,13 +318,13 @@ interface VideoToVideoMusicParams {
309
318
  * source's own audio is removed. Supersedes `preserveSpeech`. */
310
319
  keepOriginalSound?: boolean;
311
320
  /** How the voice and the generated music are combined — not whether a
312
- * voice is kept. Default-ON server-side: leave unset for the dynamic duck
313
- * (music dips only while the voice is present), pass `false` for a static
314
- * voice-forward mix at a fixed offset. Has no effect when there is no
315
- * voice source, i.e. neither `keepOriginalSound` nor `preserveSpeech` is
316
- * set. Free and best-effort; silently falls back to generated-audio-only
317
- * if the source has no usable audio track, voice isolation fails, or the
318
- * mix fails. */
321
+ * voice is kept. Default-OFF server-side: leave unset for a static
322
+ * voice-forward mix at a fixed offset, pass `true` for the dynamic duck
323
+ * (music dips only while the voice is present). Has no effect when there
324
+ * is no voice source, i.e. neither `keepOriginalSound` nor `preserveSpeech`
325
+ * is set. Free and best-effort; silently falls back to
326
+ * generated-audio-only if the source has no usable audio track, voice
327
+ * isolation fails, or the mix fails. */
319
328
  ducking?: boolean;
320
329
  /** Keep only the source's isolated speech (not the whole track) in the
321
330
  * output. Both this and the legacy `isolateVocals` are accepted and OR'd
@@ -328,6 +337,12 @@ interface VideoToVideoMusicParams {
328
337
  * by the free trial. This endpoint is always async, so no extra `mode`
329
338
  * gating applies. The result's `videos[]` gets one entry per variant. */
330
339
  variantsNum?: number;
340
+ /** How strongly the generated music follows the prompt (0-1, API default
341
+ * 0.5). Lower values let the video lead; higher values follow the prompt
342
+ * more literally. Free of charge. Omitted from the wire when unset so the
343
+ * server default applies; `0` is a meaningful value and is sent.
344
+ * Out-of-range values are rejected server-side with a 422. */
345
+ promptInfluence?: number;
331
346
  }
332
347
  interface VideoToVideoSfxParams {
333
348
  video?: VideoInput;
@@ -367,10 +382,16 @@ interface VideoToVideoSoundParams {
367
382
  /** Keep only the source's isolated speech (not the whole track) in the
368
383
  * result. Superseded by `keepOriginalSound`. */
369
384
  preserveSpeech?: boolean;
370
- /** How the voice and the generated bed are combined — not whether a voice
371
- * is kept. Default-ON server-side: leave unset for the dynamic duck, pass
372
- * `false` for a static voice-forward mix. Has no effect when there is no
373
- * voice source. */
385
+ /** On `videoToVideoSound`, how the voice and the generated bed are
386
+ * combined — not whether a voice is kept: default-OFF server-side, so an
387
+ * unset value gives a static voice-forward mix and `true` gives the dynamic
388
+ * duck, and either way it has no effect without a voice source.
389
+ *
390
+ * On `videoToSound` it decides BOTH, because that endpoint has no
391
+ * `keepOriginalSound`: unset means the source's own speech is left out of
392
+ * the deliverable entirely, and `true` is what pulls the original track in
393
+ * and ducks the bed under it. Pass `preserveSpeech` instead to bring in the
394
+ * isolated vocals rather than the whole track. */
374
395
  ducking?: boolean;
375
396
  /** How many distinct variants to generate in one request (1-10, default
376
397
  * 1). Cost scales linearly, and values above 1 are never covered by the
@@ -389,9 +410,9 @@ interface VideoToSoundParams extends VideoToVideoSoundParams {
389
410
  outputFormat?: "wav" | "m4a" | "mp3";
390
411
  /** Not available on this endpoint. `keepOriginalSound` only means something
391
412
  * when the deliverable is a video whose own audio could be preserved;
392
- * `videoToSound` returns generated audio, and its default already keeps the
393
- * source voice in the mix. Typed `never` so passing it is a compile error
394
- * rather than a field the server silently drops — the mirror of how
413
+ * `videoToSound` returns generated audio, and reaches the original track
414
+ * through `ducking: true` instead. Typed `never` so passing it is a compile
415
+ * error rather than a field the server silently drops — the mirror of how
395
416
  * `outputFormat` is kept off `videoToVideoSound`. */
396
417
  keepOriginalSound?: never;
397
418
  }
@@ -449,8 +470,8 @@ interface DubbingParams {
449
470
  languages?: DubbingLanguage[];
450
471
  /**
451
472
  * Duck the background music/effects bed under the dubbed voice. Default
452
- * OFF server-side (the opposite of video-to-music's `ducking`): the bed
453
- * is always kept, at a constant level unless this is `true`. Free.
473
+ * OFF server-side, like every other endpoint's `ducking`: the bed is
474
+ * always kept, at a constant level unless this is `true`. Free.
454
475
  */
455
476
  ducking?: boolean;
456
477
  }
@@ -703,6 +724,6 @@ declare class RequestTimeoutError extends SoniloError {
703
724
  declare function download(media: SfxMedia | string | undefined, fetchFn?: typeof globalThis.fetch, timeout?: number): Promise<Uint8Array>;
704
725
 
705
726
  /** The SDK's own version. Generated by scripts/sync-versions.mjs — do not edit. */
706
- declare const VERSION = "0.11.2";
727
+ declare const VERSION = "0.13.0";
707
728
 
708
729
  export { APIError, type AccountServices, type AudioChunkEvent, AuthenticationError, BadRequestError, type BaseTaskResult, type CompleteEvent, type CostEvent, type CostInfo, DEFAULT_TIMEOUT_MS, type DailyUsage, type DubbingLanguage, type DubbingParams, type DubbingResult, type ErrorEvent, GenerationError, type MusicMediaEntry, type MusicMuxEntry, type MusicTaskResult, type MusicTitle, PaymentRequiredError, RateLimitError, RequestTimeoutError, type Segment, type SegmentLabel, type SfxAudioFormat, type SfxError, type SfxMedia, type SfxResult, type SfxSegment, type SfxTask, SoniloClient, type SoniloClientOptions, SoniloError, type SoundOutputEntry, type SoundResult, type StreamEvent, TaskFailedError, TaskTimeoutError, type TextToMusicParams, type TextToSfxParams, type TitleEvent, type Track, TrialExhaustedError, type TrialQuota, type UnknownEvent, type UsageResponse, type UsageSummary, VERSION, type VideoInput, type VideoResult, type VideoToMusicParams, type VideoToSfxParams, type VideoToSoundParams, type VideoToVideoMusicParams, type VideoToVideoSfxParams, type VideoToVideoSoundParams, type WaitOptions, download, isAudioChunkEvent, isErrorEvent };
package/dist/index.d.ts CHANGED
@@ -100,8 +100,9 @@ interface VideoToMusicParams {
100
100
  * finalize-time transcodes and require async. Defaults to m4a. */
101
101
  outputFormat?: "m4a" | "wav" | "mp3";
102
102
  /** Duck the generated music under the source voice at finalize time.
103
- * Default-ON server-side in async mode: leave unset to keep it on, pass
104
- * `false` to opt out. Free, best-effort; only valid on `submit()`. */
103
+ * Default-OFF server-side: leave unset to skip it, pass `true` to run it,
104
+ * which adds a `ducked` track alongside the unchanged clean `audio`. Free,
105
+ * best-effort; only valid on `submit()`. */
105
106
  ducking?: boolean;
106
107
  /** How many distinct music variants to generate in one request (1-10,
107
108
  * default 1). Cost scales linearly, and values above 1 are never covered
@@ -109,6 +110,14 @@ interface VideoToMusicParams {
109
110
  * by `submit()`) — only meaningful via `submit()`; `stream()`/`generate()`
110
111
  * never send it, since they always request a plain stream. */
111
112
  variantsNum?: number;
113
+ /** How strongly the generated music follows the prompt (0-1, API default
114
+ * 0.5). Lower values let the video lead; higher values follow the prompt
115
+ * more literally. Free of charge. A generation-time knob, not a
116
+ * finalize-time one, so it works on the plain stream as well as async —
117
+ * no `mode` gating. Omitted from the wire when unset so the server
118
+ * default applies; `0` is a meaningful value and is sent. Out-of-range
119
+ * values are rejected server-side with a 422. */
120
+ promptInfluence?: number;
112
121
  }
113
122
  /** One service's free-trial allowance. `remaining` is already floored at 0,
114
123
  * so it is safe to compare directly. */
@@ -282,10 +291,10 @@ interface VideoResult extends BaseTaskResult {
282
291
  * | Request | Audio in the returned video |
283
292
  * | --- | --- |
284
293
  * | neither set | generated music only — the source's own audio is removed |
285
- * | `keepOriginalSound: true` | full original sound + music ducked under it |
286
- * | `keepOriginalSound: true, ducking: false` | full original sound + static music mix |
287
- * | `preserveSpeech: true` | isolated vocals + music ducked under them |
288
- * | `preserveSpeech: true, ducking: false` | static vocal-forward mix of vocals + music |
294
+ * | `keepOriginalSound: true` | full original sound + static music mix |
295
+ * | `keepOriginalSound: true, ducking: true` | full original sound + music ducked under it |
296
+ * | `preserveSpeech: true` | static vocal-forward mix of vocals + music |
297
+ * | `preserveSpeech: true, ducking: true` | isolated vocals + music ducked under them |
289
298
  *
290
299
  * `keepOriginalSound` supersedes `preserveSpeech` — the voice source is a
291
300
  * single choice, and keeping the whole track subsumes keeping only the
@@ -309,13 +318,13 @@ interface VideoToVideoMusicParams {
309
318
  * source's own audio is removed. Supersedes `preserveSpeech`. */
310
319
  keepOriginalSound?: boolean;
311
320
  /** How the voice and the generated music are combined — not whether a
312
- * voice is kept. Default-ON server-side: leave unset for the dynamic duck
313
- * (music dips only while the voice is present), pass `false` for a static
314
- * voice-forward mix at a fixed offset. Has no effect when there is no
315
- * voice source, i.e. neither `keepOriginalSound` nor `preserveSpeech` is
316
- * set. Free and best-effort; silently falls back to generated-audio-only
317
- * if the source has no usable audio track, voice isolation fails, or the
318
- * mix fails. */
321
+ * voice is kept. Default-OFF server-side: leave unset for a static
322
+ * voice-forward mix at a fixed offset, pass `true` for the dynamic duck
323
+ * (music dips only while the voice is present). Has no effect when there
324
+ * is no voice source, i.e. neither `keepOriginalSound` nor `preserveSpeech`
325
+ * is set. Free and best-effort; silently falls back to
326
+ * generated-audio-only if the source has no usable audio track, voice
327
+ * isolation fails, or the mix fails. */
319
328
  ducking?: boolean;
320
329
  /** Keep only the source's isolated speech (not the whole track) in the
321
330
  * output. Both this and the legacy `isolateVocals` are accepted and OR'd
@@ -328,6 +337,12 @@ interface VideoToVideoMusicParams {
328
337
  * by the free trial. This endpoint is always async, so no extra `mode`
329
338
  * gating applies. The result's `videos[]` gets one entry per variant. */
330
339
  variantsNum?: number;
340
+ /** How strongly the generated music follows the prompt (0-1, API default
341
+ * 0.5). Lower values let the video lead; higher values follow the prompt
342
+ * more literally. Free of charge. Omitted from the wire when unset so the
343
+ * server default applies; `0` is a meaningful value and is sent.
344
+ * Out-of-range values are rejected server-side with a 422. */
345
+ promptInfluence?: number;
331
346
  }
332
347
  interface VideoToVideoSfxParams {
333
348
  video?: VideoInput;
@@ -367,10 +382,16 @@ interface VideoToVideoSoundParams {
367
382
  /** Keep only the source's isolated speech (not the whole track) in the
368
383
  * result. Superseded by `keepOriginalSound`. */
369
384
  preserveSpeech?: boolean;
370
- /** How the voice and the generated bed are combined — not whether a voice
371
- * is kept. Default-ON server-side: leave unset for the dynamic duck, pass
372
- * `false` for a static voice-forward mix. Has no effect when there is no
373
- * voice source. */
385
+ /** On `videoToVideoSound`, how the voice and the generated bed are
386
+ * combined — not whether a voice is kept: default-OFF server-side, so an
387
+ * unset value gives a static voice-forward mix and `true` gives the dynamic
388
+ * duck, and either way it has no effect without a voice source.
389
+ *
390
+ * On `videoToSound` it decides BOTH, because that endpoint has no
391
+ * `keepOriginalSound`: unset means the source's own speech is left out of
392
+ * the deliverable entirely, and `true` is what pulls the original track in
393
+ * and ducks the bed under it. Pass `preserveSpeech` instead to bring in the
394
+ * isolated vocals rather than the whole track. */
374
395
  ducking?: boolean;
375
396
  /** How many distinct variants to generate in one request (1-10, default
376
397
  * 1). Cost scales linearly, and values above 1 are never covered by the
@@ -389,9 +410,9 @@ interface VideoToSoundParams extends VideoToVideoSoundParams {
389
410
  outputFormat?: "wav" | "m4a" | "mp3";
390
411
  /** Not available on this endpoint. `keepOriginalSound` only means something
391
412
  * when the deliverable is a video whose own audio could be preserved;
392
- * `videoToSound` returns generated audio, and its default already keeps the
393
- * source voice in the mix. Typed `never` so passing it is a compile error
394
- * rather than a field the server silently drops — the mirror of how
413
+ * `videoToSound` returns generated audio, and reaches the original track
414
+ * through `ducking: true` instead. Typed `never` so passing it is a compile
415
+ * error rather than a field the server silently drops — the mirror of how
395
416
  * `outputFormat` is kept off `videoToVideoSound`. */
396
417
  keepOriginalSound?: never;
397
418
  }
@@ -449,8 +470,8 @@ interface DubbingParams {
449
470
  languages?: DubbingLanguage[];
450
471
  /**
451
472
  * Duck the background music/effects bed under the dubbed voice. Default
452
- * OFF server-side (the opposite of video-to-music's `ducking`): the bed
453
- * is always kept, at a constant level unless this is `true`. Free.
473
+ * OFF server-side, like every other endpoint's `ducking`: the bed is
474
+ * always kept, at a constant level unless this is `true`. Free.
454
475
  */
455
476
  ducking?: boolean;
456
477
  }
@@ -703,6 +724,6 @@ declare class RequestTimeoutError extends SoniloError {
703
724
  declare function download(media: SfxMedia | string | undefined, fetchFn?: typeof globalThis.fetch, timeout?: number): Promise<Uint8Array>;
704
725
 
705
726
  /** The SDK's own version. Generated by scripts/sync-versions.mjs — do not edit. */
706
- declare const VERSION = "0.11.2";
727
+ declare const VERSION = "0.13.0";
707
728
 
708
729
  export { APIError, type AccountServices, type AudioChunkEvent, AuthenticationError, BadRequestError, type BaseTaskResult, type CompleteEvent, type CostEvent, type CostInfo, DEFAULT_TIMEOUT_MS, type DailyUsage, type DubbingLanguage, type DubbingParams, type DubbingResult, type ErrorEvent, GenerationError, type MusicMediaEntry, type MusicMuxEntry, type MusicTaskResult, type MusicTitle, PaymentRequiredError, RateLimitError, RequestTimeoutError, type Segment, type SegmentLabel, type SfxAudioFormat, type SfxError, type SfxMedia, type SfxResult, type SfxSegment, type SfxTask, SoniloClient, type SoniloClientOptions, SoniloError, type SoundOutputEntry, type SoundResult, type StreamEvent, TaskFailedError, TaskTimeoutError, type TextToMusicParams, type TextToSfxParams, type TitleEvent, type Track, TrialExhaustedError, type TrialQuota, type UnknownEvent, type UsageResponse, type UsageSummary, VERSION, type VideoInput, type VideoResult, type VideoToMusicParams, type VideoToSfxParams, type VideoToSoundParams, type VideoToVideoMusicParams, type VideoToVideoSfxParams, type VideoToVideoSoundParams, type WaitOptions, download, isAudioChunkEvent, isErrorEvent };
package/dist/index.js CHANGED
@@ -392,6 +392,9 @@ var VideoToMusic = class {
392
392
  if (params.segments !== void 0) {
393
393
  form.set("segments", JSON.stringify(params.segments));
394
394
  }
395
+ if (params.promptInfluence !== void 0) {
396
+ form.set("prompt_influence", String(params.promptInfluence));
397
+ }
395
398
  const res = await this.client.request(
396
399
  "/v1/video-to-music",
397
400
  { method: "POST", body: form, signal: params.signal },
@@ -452,6 +455,9 @@ var VideoToMusic = class {
452
455
  if (params.variantsNum !== void 0) {
453
456
  form.set("variants_num", String(params.variantsNum));
454
457
  }
458
+ if (params.promptInfluence !== void 0) {
459
+ form.set("prompt_influence", String(params.promptInfluence));
460
+ }
455
461
  const res = await this.client.request("/v1/video-to-music", {
456
462
  method: "POST",
457
463
  body: form
@@ -548,6 +554,9 @@ var VideoToVideoMusic = class {
548
554
  if (params.variantsNum !== void 0) {
549
555
  form.set("variants_num", String(params.variantsNum));
550
556
  }
557
+ if (params.promptInfluence !== void 0) {
558
+ form.set("prompt_influence", String(params.promptInfluence));
559
+ }
551
560
  const res = await this.client.request("/v1/video-to-video-music", {
552
561
  method: "POST",
553
562
  body: form
@@ -705,7 +714,7 @@ var Dubbing = class {
705
714
  };
706
715
 
707
716
  // src/version.ts
708
- var VERSION = "0.11.2";
717
+ var VERSION = "0.13.0";
709
718
 
710
719
  // src/client.ts
711
720
  var DEFAULT_BASE_URL = "https://api.sonilo.com";