@capacitor-community/text-to-speech
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -26,4 +26,4 @@ declare module "@capacitor/core" { | ||
locale?: string; | ||
rate?: number; | ||
pitch?: number; | ||
speechRate?: number; | ||
pitchRate?: number; | ||
volume?: number; | ||
@@ -30,0 +30,0 @@ voice?: number; |
@@ -28,3 +28,3 @@ import { WebPlugin } from "@capacitor/core"; | ||
} | ||
const { text, locale, rate, volume, voice, pitch } = options; | ||
const { text, locale, speechRate, volume, voice, pitchRate } = options; | ||
if (!this.activeUtterance) { | ||
@@ -34,7 +34,9 @@ this.activeUtterance = new SpeechSynthesisUtterance(); | ||
this.activeUtterance.voice = this.supportedVoices[voice]; | ||
this.activeUtterance.rate = rate >= 0.1 && rate <= 10 ? rate : 1; | ||
this.activeUtterance.rate = | ||
speechRate >= 0.1 && speechRate <= 10 ? speechRate : 1; | ||
this.activeUtterance.volume = volume >= 0 && volume <= 1 ? volume : 1; | ||
this.activeUtterance.text = text; | ||
this.activeUtterance.lang = locale; | ||
this.activeUtterance.pitch = pitch >= 0 && pitch <= 2 ? pitch : 2; | ||
this.activeUtterance.pitch = | ||
pitchRate >= 0 && pitchRate <= 2 ? pitchRate : 2; | ||
if (voice) { | ||
@@ -41,0 +43,0 @@ this.activeUtterance.voice = voice; |
{ | ||
"name": "@capacitor-community/text-to-speech", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A native plugin for text to speech engine", | ||
@@ -5,0 +5,0 @@ "main": "dist/esm/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
392331
220