maoda-commander-tt 0.0.41 → 0.0.42

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
@@ -61,7 +61,7 @@ pnpm start -- --help
61
61
  ## AI 音频生成
62
62
 
63
63
  `ai audio` 接受一段自然语言提示词并等待 XYQ 返回 MP3。参考音频可选;提供时,
64
- 提示词可以用“参考音频1”描述要复用的音色。
64
+ 提示词需自行用 `@音频1` 引用它,命令不会改写提示词。
65
65
 
66
66
  ```bash
67
67
  # 纯文本生成音频
@@ -69,11 +69,11 @@ tt ai audio '萝莉音说:“我今天不回来了”'
69
69
 
70
70
  # 参考一段本地音频的音色
71
71
  tt ai audio --audio ./reference.mp3 \
72
- '参考音频1的音色,说:“我生气了,哼”'
72
+ '@音频1 参考它的音色,说:“我生气了,哼”'
73
73
 
74
74
  # 等待生成并下载到本地;省略 --output 时返回远端地址
75
75
  tt ai audio --audio ./reference.mp3 --output ./result.mp3 \
76
- '参考音频1的音色,说:“我生气了,哼”'
76
+ '@音频1 参考它的音色,说:“我生气了,哼”'
77
77
  ```
78
78
 
79
79
  命令固定使用 `seedaudio_1.0`、MP3 和 44.1 kHz,最多等待 60 秒。参考音频直接
package/dist/main.js CHANGED
@@ -3353,7 +3353,7 @@ var XyqSession = class {
3353
3353
  const submittedAt = this._now();
3354
3354
  const body = buildSubmitAudioBody({
3355
3355
  prompt,
3356
- pippitAssetId: normalizeString2(input.pippitAssetId),
3356
+ referenceAudioPippitAssetId: normalizeString2(input.pippitAssetId),
3357
3357
  threadId,
3358
3358
  clientRunId,
3359
3359
  messageId,
@@ -3853,7 +3853,14 @@ function buildSubmitAudioBody(input) {
3853
3853
  loudness_rate: 0,
3854
3854
  pitch_rate: 0
3855
3855
  },
3856
- ...input.pippitAssetId ? { pippit_asset_id: input.pippitAssetId } : {}
3856
+ ...input.referenceAudioPippitAssetId ? {
3857
+ references: [
3858
+ {
3859
+ type: "audio",
3860
+ pippit_asset_id: input.referenceAudioPippitAssetId
3861
+ }
3862
+ ]
3863
+ } : {}
3857
3864
  };
3858
3865
  const runExtra = {
3859
3866
  babi_param: {
@@ -4757,7 +4764,7 @@ var AiAudioCommand = class extends AiBaseCommand {
4757
4764
  }
4758
4765
  _configureOptions(cmd) {
4759
4766
  cmd.addOption(
4760
- new Option8("--audio <path>", "\u53EF\u9009\u53C2\u8003\u97F3\u9891\uFF0C\u6700\u591A\u4E00\u4E2A").argParser(appendAudioPath)
4767
+ new Option8("--audio <path>", "\u53EF\u9009\u53C2\u8003\u97F3\u9891\uFF0C\u6700\u591A\u4E00\u4E2A\uFF1B\u63D0\u793A\u8BCD\u9700\u7528 @\u97F3\u98911 \u5F15\u7528").argParser(appendAudioPath)
4761
4768
  );
4762
4769
  cmd.addOption(
4763
4770
  new Option8(
@@ -4793,7 +4800,7 @@ var AiAudioCommand = class extends AiBaseCommand {
4793
4800
  return this._fail(sessionResult.code, sessionResult.msg);
4794
4801
  }
4795
4802
  const session = sessionResult.value;
4796
- let pippitAssetId;
4803
+ let referenceAudioPippitAssetId;
4797
4804
  if (audioPath) {
4798
4805
  const uploadResult = await session.uploadAudio(audioPath, {
4799
4806
  useCache: false
@@ -4801,14 +4808,14 @@ var AiAudioCommand = class extends AiBaseCommand {
4801
4808
  if (!uploadResult.ok) {
4802
4809
  return this._fail(uploadResult.code, uploadResult.msg);
4803
4810
  }
4804
- pippitAssetId = uploadResult.value.pippitAssetId?.trim();
4805
- if (!pippitAssetId) {
4811
+ referenceAudioPippitAssetId = uploadResult.value.pippitAssetId?.trim();
4812
+ if (!referenceAudioPippitAssetId) {
4806
4813
  return this._fail(1, "\u53C2\u8003\u97F3\u9891\u4E0A\u4F20\u6210\u529F\uFF0C\u4F46\u672A\u8FD4\u56DE pippitAssetId");
4807
4814
  }
4808
4815
  }
4809
4816
  const submitResult = await session.submitAudio({
4810
4817
  prompt,
4811
- ...pippitAssetId ? { pippitAssetId } : {}
4818
+ ...referenceAudioPippitAssetId ? { pippitAssetId: referenceAudioPippitAssetId } : {}
4812
4819
  });
4813
4820
  if (!submitResult.ok) {
4814
4821
  return this._fail(submitResult.code, submitResult.msg);