mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Replace <p> with <break> in ssml
This commit is contained in:
parent
e1123cc422
commit
9545d1d532
2 changed files with 3 additions and 8 deletions
|
|
@ -55,8 +55,7 @@ const ANCHOR_ELEMENTS_BLOCKED_ATTRIBUTES = [
|
|||
|
||||
function ssmlTagsForTopLevelElement() {
|
||||
return {
|
||||
opening: `<p>`,
|
||||
closing: `</p>`,
|
||||
opening: `<break />`,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,10 +179,6 @@ function emitElement(
|
|||
}
|
||||
}
|
||||
|
||||
if (isTopLevel) {
|
||||
emit(textItems, topLevelTags.closing)
|
||||
}
|
||||
|
||||
return Number(maxVisitedIdx)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export const synthesizeTextToSpeech = async (
|
|||
}
|
||||
}
|
||||
// for ssml
|
||||
const audioData: Buffer = Buffer.from([])
|
||||
let audioData: Buffer = Buffer.from([])
|
||||
// split ssml into chunks of 200 characters to stream faster
|
||||
const ssmlChunks = input.text.match(/.{1,200}/g)
|
||||
// TODO: not split on words and bookmarks
|
||||
|
|
@ -151,7 +151,7 @@ export const synthesizeTextToSpeech = async (
|
|||
}
|
||||
timeOffset = timeOffset + result.audioDuration
|
||||
wordOffset = wordOffset + ssmlChunk.length
|
||||
Buffer.concat([audioData, Buffer.from(result.audioData)])
|
||||
audioData = Buffer.concat([audioData, Buffer.from(result.audioData)])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue