feat: male voice ok
This commit is contained in:
+13
-3
@@ -486,9 +486,19 @@ exports.generateMusic = onCall(async ({ data = {} }) => {
|
|||||||
|
|
||||||
// Normalisation input Voix (peut être array, string ou objet selon ta spec)
|
// Normalisation input Voix (peut être array, string ou objet selon ta spec)
|
||||||
let voiceData = []
|
let voiceData = []
|
||||||
if (Array.isArray(voice)) voiceData = voice
|
if (Array.isArray(voice)) {
|
||||||
else if (typeof voice === 'object' && voice !== null) voiceData = Object.values(voice).flat()
|
voiceData = voice
|
||||||
else if (typeof voice === 'string') 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)
|
// 1. Construction du STYLE MUSICAL (Tags)
|
||||||
const optimizedStyle = buildSunoStyle({
|
const optimizedStyle = buildSunoStyle({
|
||||||
|
|||||||
Reference in New Issue
Block a user