@nodaro/sdk 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -270,7 +270,7 @@ try {
270
270
  | `client.locations` | Location Studio: CRUD, assets, atmosphere motion |
271
271
  | `client.objects` | Object Studio: CRUD, assets, motion |
272
272
  | `client.creatures` | Creature Studio: CRUD, assets, motion |
273
- | `client.voices` | Voice design, clone, remix, recast |
273
+ | `client.voices` | Voice catalog + clones (from URL or file), voice changer, multi-speaker recast + the interactive `analyze`/stems/`exportMix` flow, design, remix, dubbing |
274
274
  | `client.pipelines` | Showrunner pipelines: stages, approvals, chat, branch |
275
275
  | `client.reduce` | Fan-in reducer (pick-best, concat, vote, merge…) |
276
276
  | `client.promptHelper` | Prompt enhancement / wizard |
package/dist/index.cjs CHANGED
@@ -1551,6 +1551,185 @@ var VoicesResource = class {
1551
1551
  recast(input) {
1552
1552
  return this.client.request("POST", "/v1/voice-changer-pro", { body: input });
1553
1553
  }
1554
+ /**
1555
+ * Detect the speakers in a clip WITHOUT recasting yet
1556
+ * (`POST /v1/voice-changer-pro/analyze`) — the first step of the interactive
1557
+ * flow. Separates voice from music once and diarizes the vocals, returning the
1558
+ * speaker list so a user (or agent) can choose a voice per speaker before
1559
+ * committing to a paid recast. Poll `jobs.get(jobId)`: the completed job's
1560
+ * `output_data` carries the separated stem urls + the detected `speakers`
1561
+ * (each with `id`, time `segments`, `firstStartSec`, `wordCount`, `snippet`)
1562
+ * and the detected language — reshape it into a {@link VcpAnalysis} and pass it
1563
+ * as `recast({ ..., analysis })` to skip re-detection. With `suggestTitle`,
1564
+ * `output_data.suggestedTitle` also carries an LLM-proposed title.
1565
+ *
1566
+ * Cloud-only; costs credits and runs async.
1567
+ */
1568
+ analyze(input) {
1569
+ return this.client.request("POST", "/v1/voice-changer-pro/analyze", { body: input });
1570
+ }
1571
+ /**
1572
+ * Render a final video from a mixed set of stems
1573
+ * (`POST /v1/voice-changer-pro/export`) — the last step of the interactive
1574
+ * flow. After `recast({ output: "stems" })` hands back the dry per-track stems
1575
+ * and the user has set levels / mutes / an effect in your editor, pass those
1576
+ * `tracks` (plus the source `videoUrl`) here to mix and remux into the finished
1577
+ * video. The video is stream-copied (never re-encoded), so the export is
1578
+ * bit-identical to your preview. At least one track must be un-muted (all-muted
1579
+ * is a 400); `voiceFx` is applied to the voice tracks at render time.
1580
+ *
1581
+ * Cloud-only; costs credits and runs async — poll `jobs.get(jobId)` for the
1582
+ * result (`output_data.videoUrl`).
1583
+ */
1584
+ exportMix(input) {
1585
+ return this.client.request("POST", "/v1/voice-changer-pro/export", { body: input });
1586
+ }
1587
+ /**
1588
+ * Design a brand-new synthetic voice from a text description
1589
+ * (`POST /v1/voice-design`) — ElevenLabs text-to-voice. `text` (100–1000 chars)
1590
+ * is a preview line spoken in the designed voice; `voiceDescription` describes
1591
+ * the voice to create. Costs credits and runs async — poll `jobs.get(jobId)`
1592
+ * for the preview + the reusable voice id.
1593
+ */
1594
+ design(input) {
1595
+ return this.client.request("POST", "/v1/voice-design", { body: input });
1596
+ }
1597
+ /**
1598
+ * Generate speech in a voice described in natural language, without cloning
1599
+ * (`POST /v1/voice-remix`). `text` (1–5000 chars) is spoken in a voice matching
1600
+ * `voiceDescription`. Costs credits and runs async — poll `jobs.get(jobId)`.
1601
+ */
1602
+ remix(input) {
1603
+ return this.client.request("POST", "/v1/voice-remix", { body: input });
1604
+ }
1605
+ /**
1606
+ * Dub an audio clip into another language while preserving each speaker's voice
1607
+ * (`POST /v1/dubbing`). `targetLanguage` is an ISO code (e.g. `"es"`, `"fr"`);
1608
+ * `sourceLanguage` is auto-detected when omitted. Costs credits and runs async
1609
+ * — poll `jobs.get(jobId)`.
1610
+ */
1611
+ dub(input) {
1612
+ return this.client.request("POST", "/v1/dubbing", { body: input });
1613
+ }
1614
+ /**
1615
+ * Clone a voice from an audio FILE you hold in memory
1616
+ * (`POST /v1/voice-clones`, multipart) — the counterpart to
1617
+ * {@link VoicesResource.createClone}, which clones from an already-uploaded
1618
+ * URL. Pass the raw audio `file` (a `Blob`/`File` in the browser, or a
1619
+ * `Uint8Array`/`Buffer` in Node) plus a `name`. Costs credits. Returns the new
1620
+ * {@link VoiceClone} (`elevenlabsVoiceId` is the id to recast/synthesize with).
1621
+ */
1622
+ createCloneFromFile(input) {
1623
+ const form = new FormData();
1624
+ form.append("name", input.name);
1625
+ const blob = input.file instanceof Blob ? input.file : new Blob([input.file], { type: input.contentType ?? "audio/mpeg" });
1626
+ form.append("file", blob, input.filename ?? "sample");
1627
+ return this.client.request("POST", "/v1/voice-clones", { body: form });
1628
+ }
1629
+ };
1630
+
1631
+ // src/resources/media.ts
1632
+ var MediaResource = class {
1633
+ constructor(client) {
1634
+ this.client = client;
1635
+ }
1636
+ client;
1637
+ /**
1638
+ * Download a social video (YouTube / TikTok / Instagram / X / Facebook) into
1639
+ * your storage (`POST /v1/download-video`). `maxHeight` caps the resolution
1640
+ * (default "best"); `sectionStartSec` + `sectionEndSec` (both-or-neither) fetch
1641
+ * ONLY that time range instead of the whole video. Returns a `downloadId`;
1642
+ * progress streams from `GET /v1/download-video/progress/:downloadId`
1643
+ * (server-sent events) and the finished file lands in your library.
1644
+ */
1645
+ downloadVideo(input) {
1646
+ return this.client.request("POST", "/v1/download-video", { body: input });
1647
+ }
1648
+ /**
1649
+ * Copy an external media URL into your Nodaro storage (`POST /v1/save-to-storage`)
1650
+ * — a server-side fetch, so nothing round-trips through the client. Poll
1651
+ * `jobs.get(jobId)`.
1652
+ */
1653
+ saveToStorage(input) {
1654
+ return this.client.request("POST", "/v1/save-to-storage", { body: input });
1655
+ }
1656
+ /**
1657
+ * Trim a video to a range (`POST /v1/trim-video`). Give the range in whichever
1658
+ * unit fits: `startTime`/`endTime` seconds, `trim*Frames`, `trim*Seconds`, or
1659
+ * `keepFirst`/`keepLastSeconds`. Poll `jobs.get(jobId)`.
1660
+ */
1661
+ trimVideo(input) {
1662
+ return this.client.request("POST", "/v1/trim-video", { body: input });
1663
+ }
1664
+ /**
1665
+ * Trim (and extract) audio from a video or audio source
1666
+ * (`POST /v1/trim-audio`) to `[startTime, endTime]` seconds, in `audioFormat`
1667
+ * (`mp3` default / `wav` / `aac`). Poll `jobs.get(jobId)`.
1668
+ */
1669
+ trimAudio(input) {
1670
+ return this.client.request("POST", "/v1/trim-audio", { body: input });
1671
+ }
1672
+ /**
1673
+ * Probe a social video's metadata (`POST /v1/video-metadata`) — duration,
1674
+ * dimensions, title, live status — WITHOUT downloading it. A direct read, not a
1675
+ * job. Use it to decide whether to trim before importing.
1676
+ */
1677
+ videoMetadata(input) {
1678
+ return this.client.request("POST", "/v1/video-metadata", { body: input });
1679
+ }
1680
+ };
1681
+
1682
+ // src/resources/audio.ts
1683
+ var AudioResource = class {
1684
+ constructor(client) {
1685
+ this.client = client;
1686
+ }
1687
+ client;
1688
+ /**
1689
+ * Separate an audio track into stems (`POST /v1/audio-separation`, Demucs).
1690
+ * `mode` `"vocal_instrumental"` (default) splits voice from music/SFX;
1691
+ * `"stems"` returns the full drums/bass/other/… breakdown. `quality`
1692
+ * `auto` (default) / `fast` / `best`.
1693
+ */
1694
+ separate(input) {
1695
+ return this.client.request("POST", "/v1/audio-separation", { body: input });
1696
+ }
1697
+ /** Isolate the primary voice and strip background noise (`POST /v1/audio-isolation`, ElevenLabs). */
1698
+ isolate(input) {
1699
+ return this.client.request("POST", "/v1/audio-isolation", { body: input });
1700
+ }
1701
+ /**
1702
+ * Apply a reverb / echo / telephone / megaphone effect to an audio track
1703
+ * (`POST /v1/audio-fx`) — the same presets VCP's `voiceFx` uses, standalone.
1704
+ * `mix` (0–100) is the reverb wet/dry; `delayMs` + `decay` drive `echo`/`custom`;
1705
+ * `eqLow`/`eqHigh` (dB) shape telephone/megaphone.
1706
+ */
1707
+ applyFx(input) {
1708
+ return this.client.request("POST", "/v1/audio-fx", { body: input });
1709
+ }
1710
+ /**
1711
+ * Layer multiple audio tracks into one (`POST /v1/mix-audio`). `audioUrls`
1712
+ * (2–20) are summed; optional `trackVolumes` (0–200% each, positionally) set
1713
+ * per-track level.
1714
+ */
1715
+ mix(input) {
1716
+ return this.client.request("POST", "/v1/mix-audio", { body: input });
1717
+ }
1718
+ /**
1719
+ * Adjust an audio (or a video's audio) level (`POST /v1/adjust-volume`):
1720
+ * `volume` % (default 100), `normalize` to loudnorm, and `fadeIn`/`fadeOut`
1721
+ * seconds. Provide `audioUrl` or `videoUrl`.
1722
+ */
1723
+ adjustVolume(input) {
1724
+ return this.client.request("POST", "/v1/adjust-volume", { body: input });
1725
+ }
1726
+ /**
1727
+ * Concatenate audio segments end-to-end (`POST /v1/combine-audio`). Each
1728
+ * segment is a `url` with an optional `[startTime, endTime]` sub-range.
1729
+ */
1730
+ combine(input) {
1731
+ return this.client.request("POST", "/v1/combine-audio", { body: input });
1732
+ }
1554
1733
  };
1555
1734
 
1556
1735
  // src/resources/credits.ts
@@ -1853,6 +2032,8 @@ var NodaroClient = class {
1853
2032
  reduce;
1854
2033
  promptHelper;
1855
2034
  voices;
2035
+ media;
2036
+ audio;
1856
2037
  credits;
1857
2038
  uploads;
1858
2039
  library;
@@ -1880,6 +2061,8 @@ var NodaroClient = class {
1880
2061
  this.reduce = new ReduceResource(this);
1881
2062
  this.promptHelper = new PromptHelperResource(this);
1882
2063
  this.voices = new VoicesResource(this);
2064
+ this.media = new MediaResource(this);
2065
+ this.audio = new AudioResource(this);
1883
2066
  this.credits = new CreditsResource(this);
1884
2067
  this.uploads = new UploadsResource(this);
1885
2068
  this.library = new LibraryResource(this);
@@ -2046,6 +2229,7 @@ Object.defineProperty(exports, "SURROUND_DIRECTIONS", {
2046
2229
  get: function () { return shared.SURROUND_DIRECTIONS; }
2047
2230
  });
2048
2231
  exports.AppsResource = AppsResource;
2232
+ exports.AudioResource = AudioResource;
2049
2233
  exports.CREATURE_ASSET_TYPES = CREATURE_ASSET_TYPES;
2050
2234
  exports.CallbackAuth = CallbackAuth;
2051
2235
  exports.CharactersResource = CharactersResource;
@@ -2062,6 +2246,7 @@ exports.JobTimeoutError = JobTimeoutError;
2062
2246
  exports.JobsResource = JobsResource;
2063
2247
  exports.LibraryResource = LibraryResource;
2064
2248
  exports.LocationsResource = LocationsResource;
2249
+ exports.MediaResource = MediaResource;
2065
2250
  exports.NodaroClient = NodaroClient;
2066
2251
  exports.NodaroError = NodaroError;
2067
2252
  exports.NodesResource = NodesResource;