@sage-rsc/talking-head-react 1.0.64 → 1.0.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-rsc/talking-head-react",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "A reusable React component for 3D talking avatars with lip-sync and text-to-speech",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -444,9 +444,17 @@ const TalkingHeadAvatar = forwardRef(({
444
444
  let remainingText = '';
445
445
  if (talkingHead.speechQueue && talkingHead.speechQueue.length > 0 && pausedSpeechRef.current) {
446
446
  // Extract text from remaining queue items
447
+ // Note: item.text is an array of objects like [{mark: 0, word: "Hello"}, {mark: 1, word: "world"}]
447
448
  const remainingParts = talkingHead.speechQueue
448
- .filter(item => item && item.text) // Only get items with text
449
- .map(item => item.text)
449
+ .filter(item => item && item.text && Array.isArray(item.text) && item.text.length > 0)
450
+ .map(item => {
451
+ // Extract words from the text array
452
+ return item.text
453
+ .map(wordObj => wordObj.word || '')
454
+ .filter(word => word.length > 0)
455
+ .join(' ');
456
+ })
457
+ .filter(text => text.length > 0)
450
458
  .join(' ');
451
459
 
452
460
  if (remainingParts && remainingParts.trim()) {