Skip to content

Commit

Permalink
refactor: clean up audio handling
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepat0 committed Jan 7, 2025
1 parent 6e90a9f commit bb08519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/MemoriWidget/MemoriWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1922,11 +1922,10 @@ const MemoriWidget = ({
return;
}
stopListening();
// stopAudio();

if (preview) return;

if (muteSpeaker || speakerMuted) {
if (speakerMuted) {
memoriSpeaking = false;
setMemoriTyping(false);

Expand All @@ -1945,6 +1944,7 @@ const MemoriWidget = ({
window.navigator.userAgent.includes('Safari') &&
!window.navigator.userAgent.includes('Chrome');
let isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);

if ((audioContext.state as string) === 'interrupted') {
audioContext.resume().then(() => speak(text));
return;
Expand Down

0 comments on commit bb08519

Please sign in to comment.