import { SentenceRange } from './getSentenceRanges.js'; import '@storyteller-platform/ghost-story'; import '@echogarden/text-segmentation'; import '@storyteller-platform/mapping'; /** A "slot" is a sentence that needs to be synthesised. */ type Slot = { chapterId: string; id: number; }; /** * Maps a slot to the character length of its sentence text, used to weight * how much of a gap's time it should occupy. Keyed by `${chapterId}\0${id}`. * Slots missing from this map (or with a non-positive length) fall back to * a weight of 1, i.e. even division, same as before this map existed. */ type SentenceLengths = Record; declare function slotKey(slot: Slot): string; /** * Given a sequence of sentence ranges from an entire book, * ordered by occurrence in audio, interpolates sentence ranges * to fill any gaps. * * A gap may be: * - A non-linearity between two sequential sentence ranges * in the same chapter, e.g. chapter001#0 -> chapter001#3 * - A chapter whose sentence ranges start at a number greater * than 0, e.g. chapter001#330 -> chapter002#2 * - A chapter whose sentence ranges end at a number lower * than the total number of sentences in that chapter, * e.g. chapter001#325 -> chapter002#0, where * chapterSentenceCounts["chapter001"] === 330 */ declare function interpolateSentenceRanges(sentenceRanges: SentenceRange[], chapterSentenceCounts: Record, audioFileDurations: Record, sentenceLengths?: SentenceLengths): SentenceRange[]; export { type SentenceLengths, interpolateSentenceRanges, slotKey };