react-text-to-speech
Advanced tools
Comparing version 0.8.5 to 0.8.8
@@ -68,3 +68,7 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
synth.cancel(); | ||
const utterance = new window.SpeechSynthesisUtterance(words.join("\n")); | ||
const utterance = new window.SpeechSynthesisUtterance(words | ||
.join(" ") | ||
.replace(/([.!?\\-]),/g, "$1 ") | ||
.replace(/(\d),([A-z])/g, "$1 $2") | ||
.replace(/([A-z]),(\d)/g, "$1 $2")); | ||
utterance.pitch = pitch; | ||
@@ -127,5 +131,5 @@ utterance.rate = rate; | ||
useEffect(() => { | ||
var _a, _b; | ||
var _a; | ||
setUseStop(useStopOverPause !== null && useStopOverPause !== void 0 ? useStopOverPause : (((_a = navigator.userAgentData) === null || _a === void 0 ? void 0 : _a.mobile) || false)); | ||
return (_b = window.speechSynthesis) === null || _b === void 0 ? void 0 : _b.cancel(); | ||
return () => { var _a; return (_a = window.speechSynthesis) === null || _a === void 0 ? void 0 : _a.cancel(); }; | ||
}, []); | ||
@@ -132,0 +136,0 @@ useEffect(() => { |
{ | ||
"name": "react-text-to-speech", | ||
"version": "0.8.5", | ||
"version": "0.8.8", | ||
"description": "An easy to use react component for the Web Speech API.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
22255
210
1