feat: Add missing TTS models and voices (#958)
* feat: Add missing TTS models and voices * feat: Add new instruction field to create speech request - From docs: Control the voice of your generated audio with additional instructions. Does not work with tts-1 or tts-1-hd. * fix: add canary-tts back to SpeechModel
This commit is contained in:
12
speech.go
12
speech.go
@@ -8,20 +8,25 @@ import (
|
||||
type SpeechModel string
|
||||
|
||||
const (
|
||||
TTSModel1 SpeechModel = "tts-1"
|
||||
TTSModel1HD SpeechModel = "tts-1-hd"
|
||||
TTSModelCanary SpeechModel = "canary-tts"
|
||||
TTSModel1 SpeechModel = "tts-1"
|
||||
TTSModel1HD SpeechModel = "tts-1-hd"
|
||||
TTSModelCanary SpeechModel = "canary-tts"
|
||||
TTSModelGPT4oMini SpeechModel = "gpt-4o-mini-tts"
|
||||
)
|
||||
|
||||
type SpeechVoice string
|
||||
|
||||
const (
|
||||
VoiceAlloy SpeechVoice = "alloy"
|
||||
VoiceAsh SpeechVoice = "ash"
|
||||
VoiceBallad SpeechVoice = "ballad"
|
||||
VoiceCoral SpeechVoice = "coral"
|
||||
VoiceEcho SpeechVoice = "echo"
|
||||
VoiceFable SpeechVoice = "fable"
|
||||
VoiceOnyx SpeechVoice = "onyx"
|
||||
VoiceNova SpeechVoice = "nova"
|
||||
VoiceShimmer SpeechVoice = "shimmer"
|
||||
VoiceVerse SpeechVoice = "verse"
|
||||
)
|
||||
|
||||
type SpeechResponseFormat string
|
||||
@@ -39,6 +44,7 @@ type CreateSpeechRequest struct {
|
||||
Model SpeechModel `json:"model"`
|
||||
Input string `json:"input"`
|
||||
Voice SpeechVoice `json:"voice"`
|
||||
Instructions string `json:"instructions,omitempty"` // Optional, Doesnt work with tts-1 or tts-1-hd.
|
||||
ResponseFormat SpeechResponseFormat `json:"response_format,omitempty"` // Optional, default to mp3
|
||||
Speed float64 `json:"speed,omitempty"` // Optional, default to 1.0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user