@firetable/project-xiaochun 0.1.16 → 0.1.18

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-CN.md CHANGED
@@ -152,12 +152,15 @@ await xc.speakAudio(arrayBuffer, { text: '你好', motion: true, lipsync: true }
152
152
  await xc.speakAudio(blob); // Blob(mp3 / wav / ogg 等)
153
153
  await xc.speakAudio('https://cdn.example.com/voice.mp3'); // URL:默认由宿主页 fetch({ fetch: 'frame' } = 交给 iframe 去 fetch)
154
154
  await xc.speakAudio(pcm, { format: 'pcm16', sampleRate: 24000 }); // 无头原始 PCM 必须给 sampleRate(8000–96000)
155
+ await xc.speakAudio(pcm, { format: 'pcm16', sampleRate: 16000, audible: false }); // 只做动作和口型, iframe 增益为 0
155
156
 
156
157
  const s = xc.speakAudioStream({ sampleRate: 24000 }); // 流式:比如 TTS 服务边合成边返回的 PCM 块
157
158
  s.write(int16Chunk); s.write(next); s.end(); await s.done; // s.abort() 立即停止
158
159
  // 随时可取消:传 { signal: abortController.signal }
159
160
  ```
160
161
 
162
+ * `audible` 默认 `true`。`false` 仍会解码、生成动作并驱动口型,但 iframe 增益为 0,声音可以由宿主页面自己播放。
163
+ * 宿主音频的 `utterance start` 在思考动作和 EMAGE 首窗之后、声音时钟起步时才发。页面自己的播放器要等这个事件再出声,口型才对齐。
161
164
  * 失败时 reject:`bad_request`(无法解码 / 空音频 / URL 或 sampleRate 不合法)、`unsupported`、`failed`。
162
165
  * 浏览器仍要求宿主页先有用户手势才能出声,iframe 也要有 `allow="autoplay"`(SDK 已自动设置)。
163
166
  * 新的 `say()` / `speakAudio()` 会打断正在进行的那一次,被打断的 Promise 会 resolve。
package/README.md CHANGED
@@ -152,12 +152,15 @@ await xc.speakAudio(arrayBuffer, { text: 'Hi', motion: true, lipsync: true }); /
152
152
  await xc.speakAudio(blob); // Blob (mp3 / wav / ogg …)
153
153
  await xc.speakAudio('https://cdn.example.com/voice.mp3'); // URL: fetched by the host page by default ({ fetch: 'frame' } = fetched inside the iframe)
154
154
  await xc.speakAudio(pcm, { format: 'pcm16', sampleRate: 24000 }); // headerless PCM needs sampleRate (8000–96000)
155
+ await xc.speakAudio(pcm, { format: 'pcm16', sampleRate: 16000, audible: false }); // motion + lip-sync only; iframe gain is 0
155
156
 
156
157
  const s = xc.speakAudioStream({ sampleRate: 24000 }); // streaming: e.g. PCM chunks from a TTS server
157
158
  s.write(int16Chunk); s.write(next); s.end(); await s.done; // s.abort() stops immediately
158
159
  // Cancel any time: pass { signal: abortController.signal }
159
160
  ```
160
161
 
162
+ * `audible` defaults to `true`. `false` still decodes the audio, generates motion, and drives lip-sync, but the iframe gain is 0 so the host page can be the only speaker.
163
+ * For host audio, `utterance` `start` fires when the audio clock starts, after the thinking pose and the first EMAGE window. Hold the page's own player until that event if it must stay in sync.
161
164
  * Rejects with `bad_request` (undecodable / empty audio, bad URL or sampleRate), `unsupported`, or `failed`.
162
165
  * Browsers still require a user gesture on the host page before audio can play, and the iframe needs `allow="autoplay"` (the SDK sets it).
163
166
  * A newer `say()` / `speakAudio()` call preempts the one in progress, and the preempted promise resolves.
@@ -1,4 +1,4 @@
1
- /*! @firetable/project-xiaochun v0.1.16 | MIT | https://github.com/FireTable/project-xiaochun */
1
+ /*! @firetable/project-xiaochun v0.1.18 | MIT | https://github.com/FireTable/project-xiaochun */
2
2
  import {
3
3
  XC_CAMERA_RANGES,
4
4
  XC_DEFAULT_SRC,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeXcUiOption,
12
12
  parseXcUiAutoHide,
13
13
  xcMessage
14
- } from "./chunk-RHQW4QZH.js";
14
+ } from "./chunk-KL7L3MGQ.js";
15
15
 
16
16
  // src/gesture-box.ts
17
17
  var DEFAULT_RESIZE_LIMITS = Object.freeze({
@@ -1080,4 +1080,4 @@ export {
1080
1080
  defaultHeightCss,
1081
1081
  createXiaochun
1082
1082
  };
1083
- //# sourceMappingURL=chunk-UWL65W7D.js.map
1083
+ //# sourceMappingURL=chunk-BN4H52OR.js.map