From c3167a44ccfc6ec27f85f439b209277e4f2d3195 Mon Sep 17 00:00:00 2001 From: viettranx Date: Wed, 15 Apr 2026 00:01:40 +0700 Subject: [PATCH] refactor(audio): update ElevenLabs SFX provider with Manager integration --- internal/audio/elevenlabs/sfx.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/audio/elevenlabs/sfx.go b/internal/audio/elevenlabs/sfx.go index b20c5619..1ae822bf 100644 --- a/internal/audio/elevenlabs/sfx.go +++ b/internal/audio/elevenlabs/sfx.go @@ -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 }