diff --git a/packages/text-to-speech/test/fixtures/large.html b/packages/text-to-speech/test/fixtures/li.html similarity index 100% rename from packages/text-to-speech/test/fixtures/large.html rename to packages/text-to-speech/test/fixtures/li.html diff --git a/packages/text-to-speech/test/htmlToSsml.test.ts b/packages/text-to-speech/test/htmlToSsml.test.ts index f49810d9e..20f9a1d79 100644 --- a/packages/text-to-speech/test/htmlToSsml.test.ts +++ b/packages/text-to-speech/test/htmlToSsml.test.ts @@ -227,7 +227,7 @@ describe('htmlToSpeechFile', () => { describe('convert HTML to Speech file', () => { it('converts each
  • to an utterance', () => { const html = fs.readFileSync( - path.resolve(__dirname, './fixtures/large.html'), + path.resolve(__dirname, './fixtures/li.html'), { encoding: 'utf-8' } ) const speechFile = htmlToSpeechFile({ @@ -237,4 +237,21 @@ describe('convert HTML to Speech file', () => { }) expect(speechFile.utterances).to.have.lengthOf(21) }) + + it('converts long utterances to multiple utterances', () => { + const html = `
    +
    +
    + All neural voices are multilingual and fluent in their own language and English. For example, if the input text in English is "I'm excited to try text to speech" and you set es-ES-ElviraNeural, the text is spoken in English with a Spanish accent. If the voice doesn't speak the language of the input text, the Speech service won't output synthesized audio. See the full list of supported neural voices. +
    +
    +
    +` + const speechFile = htmlToSpeechFile({ + content: html, + title: 'How to synthesize speech from text', + options: TEST_OPTIONS, + }) + expect(speechFile.utterances).to.have.lengthOf(3) + }) })