🔈 fix(tts): update min value for playback rate (#2880)

* 🔈 fix: update min value for playback rate in TTS component

* fix: prevent playbackRate from being set if less than or equal to 0
This commit is contained in:
Danny Avila 2024-05-27 12:51:45 -04:00 committed by GitHub
parent b80f38e49e
commit eb5733083e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 4 deletions

View file

@ -37,7 +37,7 @@ function useTextToSpeechExternal(messageId: string, isLast: boolean, index = 0)
const playAudioPromise = (blobUrl: string) => {
const newAudio = new Audio(blobUrl);
const initializeAudio = () => {
if (playbackRate && playbackRate !== 1) {
if (playbackRate && playbackRate !== 1 && playbackRate > 0) {
newAudio.playbackRate = playbackRate;
}
};