mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add pageId to speech-file
This commit is contained in:
parent
3cf3d40482
commit
9a62a3c31e
3 changed files with 2 additions and 6 deletions
|
|
@ -102,7 +102,7 @@ export function articleRouter() {
|
|||
},
|
||||
})
|
||||
|
||||
if (outputFormat === 'speech-file') {
|
||||
if (outputFormat === 'speech') {
|
||||
const page = await getPageById(articleId)
|
||||
if (!page) {
|
||||
return res.status(404).send('Page not found')
|
||||
|
|
@ -112,7 +112,7 @@ export function articleRouter() {
|
|||
secondaryVoice: secondaryVoice,
|
||||
language: page.language,
|
||||
})
|
||||
return res.send(speechFile)
|
||||
return res.send({ ...speechFile, pageId: articleId })
|
||||
}
|
||||
|
||||
const existingSpeech = await getRepository(Speech).findOne({
|
||||
|
|
|
|||
1
packages/api/src/textToSpeech.d.ts
vendored
1
packages/api/src/textToSpeech.d.ts
vendored
|
|
@ -21,7 +21,6 @@ declare module '@omnivore/text-to-speech-handler' {
|
|||
|
||||
export interface SpeechFile {
|
||||
wordCount: number
|
||||
averageWPM: number
|
||||
language: string
|
||||
defaultVoice: string
|
||||
utterances: Utterance[]
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ export interface Utterance {
|
|||
|
||||
export interface SpeechFile {
|
||||
wordCount: number
|
||||
averageWPM: number
|
||||
language: string
|
||||
defaultVoice: string
|
||||
utterances: Utterance[]
|
||||
|
|
@ -37,7 +36,6 @@ export type SSMLOptions = {
|
|||
language?: string
|
||||
}
|
||||
|
||||
const WORDS_PER_MINUTE = 200
|
||||
const DEFAULT_LANGUAGE = 'en-US'
|
||||
const DEFAULT_VOICE = 'en-US-JennyNeural'
|
||||
const DEFAULT_RATE = 1.25
|
||||
|
|
@ -307,7 +305,6 @@ export const htmlToSpeechFile = (
|
|||
|
||||
return {
|
||||
wordCount: wordOffset,
|
||||
averageWPM: WORDS_PER_MINUTE,
|
||||
language: options.language || DEFAULT_LANGUAGE,
|
||||
defaultVoice: options.primaryVoice || DEFAULT_VOICE,
|
||||
utterances,
|
||||
|
|
|
|||
Loading…
Reference in a new issue