mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 18:15:34 +00:00
refactor(audio): update ElevenLabs SFX provider with Manager integration
This commit is contained in:
1 parent
695eba2150
commit
c3167a44cc
1 file changed
+2
-4
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user