@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/dist/index.cjs +2 -2
- package/dist/index.js +143 -143
- package/package.json +1 -1
- package/src/components/TalkingHeadAvatar.jsx +10 -2
package/package.json
CHANGED
|
@@ -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
|
|
449
|
-
.map(item =>
|
|
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()) {
|