Files
omnivore/packages/api/test/utils/textToSpeech.test.ts
2022-08-18 19:24:38 +08:00

24 lines
694 B
TypeScript

import 'mocha'
import {
synthesizeTextToSpeech,
TextToSpeechInput,
} from '../../src/utils/textToSpeech'
import { expect } from 'chai'
import { generateFakeUuid } from '../util'
describe('textToSpeech', () => {
describe('createAudioWithSpeechMarks', () => {
it('should create an audio file with speech marks', async () => {
const input: TextToSpeechInput = {
id: generateFakeUuid(),
text: 'Marry had a little lamb',
languageCode: 'en-US',
voice: 'en-US-JennyNeural',
}
const output = await synthesizeTextToSpeech(input)
expect(output.audioUrl).to.be.a('string')
expect(output.speechMarks).to.be.a('array')
})
})
})