This commit is contained in:
Timothy J. Baek
2024-06-08 13:18:42 -07:00
parent 40ea18d54d
commit 3499ec3f79
4 changed files with 14 additions and 9 deletions

View File

@@ -98,7 +98,7 @@ export const synthesizeOpenAISpeech = async (
token: string = '',
speaker: string = 'alloy',
text: string = '',
model: string = 'tts-1'
model?: string
) => {
let error = null;
@@ -109,9 +109,9 @@ export const synthesizeOpenAISpeech = async (
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: model,
input: text,
voice: speaker
voice: speaker,
...(model && { model })
})
})
.then(async (res) => {