Skip to content

Commit

Permalink
Fix emotions display, disable tts in published demo
Browse files Browse the repository at this point in the history
  • Loading branch information
miku448 committed Mar 1, 2025
1 parent cbdadd2 commit 8969e2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/interactor/src/components/chat-box/TTSPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const setAudioSpeed = (audioRef: React.RefObject<HTMLAudioElement>, playSpeed: S
};

const TTSPlayer2: React.FC = () => {
const { servicesEndpoint, isProduction, freeTTS } = useAppContext();
const { servicesEndpoint, isProduction, freeTTS, isPublishedDemo } = useAppContext();
const voiceId = useAppSelector((state) => state.settings.voice.voiceId);
const audioRef = useRef<HTMLAudioElement>(null);
const sourceBufferRef = useRef<SourceBuffer | null>(null);
Expand Down Expand Up @@ -276,7 +276,7 @@ const TTSPlayer2: React.FC = () => {
}
}, [inferAudio, autoPlay]);

// if (!isProduction) return null;
if (!isProduction || isPublishedDemo) return null;

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
opacity: 1;
transition: opacity 0.5s ease;
}

.EmotionRenderer__hidden {
opacity: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export default function EmotionRenderer({
} else {
return (
<img
className={`${className} ${!loading && upDownAnimation ? 'fade-in up-and-down' : ''}`}
className={`${className} ${!loading && upDownAnimation ? 'fade-in up-and-down' : ''} ${
loading && !blobUrl ? 'EmotionRenderer__hidden' : ''
}`}
src={blobUrl}
alt="character"
onError={({ currentTarget }) => {
Expand Down

0 comments on commit 8969e2f

Please sign in to comment.