feat: male voice ok

This commit is contained in:
2026-01-16 10:55:47 +01:00
parent dc23a9e8a0
commit f947cd194f
+13 -3
View File
@@ -486,9 +486,19 @@ exports.generateMusic = onCall(async ({ data = {} }) => {
// Normalisation input Voix (peut être array, string ou objet selon ta spec)
let voiceData = []
if (Array.isArray(voice)) voiceData = voice
else if (typeof voice === 'object' && voice !== null) voiceData = Object.values(voice).flat()
else if (typeof voice === 'string') voiceData = [voice]
if (Array.isArray(voice)) {
voiceData = voice
.map((v) => {
if (typeof v === 'object' && v !== null && v.value) return v.value
if (typeof v === 'string') return v
return ''
})
.filter(Boolean)
} else if (typeof voice === 'object' && voice !== null) {
voiceData = Object.values(voice).flat()
} else if (typeof voice === 'string') {
voiceData = [voice]
}
// 1. Construction du STYLE MUSICAL (Tags)
const optimizedStyle = buildSunoStyle({