refactor(audio): update ElevenLabs SFX provider with Manager integration

This commit is contained in:
viettranx committed 2026-04-15 11:24:57 +07:00
1 parent 695eba2150
commit c3167a44cc
1 file changed
+2 -4
+2 -4
View File
@@ -35,10 +35,7 @@ func (p *SFXProvider) Name() string { return "elevenlabs" }
// GenerateSFX produces an MP3 sound effect from opts.Prompt. Duration is
// capped at sfxMaxDurationSeconds (ElevenLabs limit).
func (p *SFXProvider) GenerateSFX(ctx context.Context, opts audio.SFXOptions) (*audio.AudioResult, error) {
duration := opts.Duration
if duration > sfxMaxDurationSeconds {
duration = sfxMaxDurationSeconds
}
duration := min(opts.Duration, sfxMaxDurationSeconds)
body := map[string]any{
"text": opts.Prompt,
@@ -68,5 +65,6 @@ func (p *SFXProvider) GenerateSFX(ctx context.Context, opts audio.SFXOptions) (*
Audio: audioBytes,
Extension: "mp3",
MimeType: "audio/mpeg",
Provider: "elevenlabs",
}, nil
}