From 8e8a6dccd00e8086c36e16f8436c7f83454203bd Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 7 Sep 2022 22:55:07 +0800 Subject: [PATCH] Change rate to string type --- packages/api/src/textToSpeech.d.ts | 2 +- packages/text-to-speech/src/htmlToSsml.ts | 4 ++-- packages/text-to-speech/src/index.ts | 4 ++-- packages/text-to-speech/src/textToSpeech.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/api/src/textToSpeech.d.ts b/packages/api/src/textToSpeech.d.ts index f27ff5aec..45e43969d 100644 --- a/packages/api/src/textToSpeech.d.ts +++ b/packages/api/src/textToSpeech.d.ts @@ -7,7 +7,7 @@ declare module '@omnivore/text-to-speech-handler' { export interface SSMLOptions { primaryVoice?: string secondaryVoice?: string - rate?: number + rate?: string language?: string } diff --git a/packages/text-to-speech/src/htmlToSsml.ts b/packages/text-to-speech/src/htmlToSsml.ts index 4aff78796..5988453e6 100644 --- a/packages/text-to-speech/src/htmlToSsml.ts +++ b/packages/text-to-speech/src/htmlToSsml.ts @@ -32,13 +32,13 @@ export type SSMLItem = { export type SSMLOptions = { primaryVoice?: string secondaryVoice?: string - rate?: number + rate?: string language?: string } const DEFAULT_LANGUAGE = 'en-US' const DEFAULT_VOICE = 'en-US-JennyNeural' -const DEFAULT_RATE = 1.25 +const DEFAULT_RATE = '1.0' const ANCHOR_ELEMENTS_BLOCKED_ATTRIBUTES = [ 'omnivore-highlight-id', diff --git a/packages/text-to-speech/src/index.ts b/packages/text-to-speech/src/index.ts index 5ca4d54f7..3d35fa3a8 100644 --- a/packages/text-to-speech/src/index.ts +++ b/packages/text-to-speech/src/index.ts @@ -13,7 +13,7 @@ import { htmlToSpeechFile } from './htmlToSsml' interface UtteranceInput { voice?: string - rate?: number + rate?: string language?: string text: string idx: string @@ -24,7 +24,7 @@ interface HTMLInput { text: string voice?: string language?: string - rate?: number + rate?: string complimentaryVoice?: string bucket: string } diff --git a/packages/text-to-speech/src/textToSpeech.ts b/packages/text-to-speech/src/textToSpeech.ts index f9679c6c4..4169e5401 100644 --- a/packages/text-to-speech/src/textToSpeech.ts +++ b/packages/text-to-speech/src/textToSpeech.ts @@ -14,7 +14,7 @@ export interface TextToSpeechInput { voice?: string language?: string textType?: 'html' | 'utterance' - rate?: number + rate?: string secondaryVoice?: string audioStream?: NodeJS.ReadWriteStream }