From 3cc1e6033fcf4cb68a8271c748dabfc6b01ac0c9 Mon Sep 17 00:00:00 2001 From: netr Date: Tue, 25 Mar 2025 22:11:46 -0700 Subject: [PATCH 1/3] feat: Add missing TTS models and voices --- speech.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/speech.go b/speech.go index 20b52e334..938c93114 100644 --- a/speech.go +++ b/speech.go @@ -8,20 +8,24 @@ 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" + 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 From bfc2cb7bcafe041feb7dec54cc8cd01010c06a59 Mon Sep 17 00:00:00 2001 From: netr Date: Tue, 25 Mar 2025 22:12:38 -0700 Subject: [PATCH 2/3] 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. --- speech.go | 1 + 1 file changed, 1 insertion(+) diff --git a/speech.go b/speech.go index 938c93114..5c5d345ea 100644 --- a/speech.go +++ b/speech.go @@ -43,6 +43,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 } From 30e833648920ac71d8750401b30674baa1f34c25 Mon Sep 17 00:00:00 2001 From: netr Date: Tue, 25 Mar 2025 22:34:13 -0700 Subject: [PATCH 3/3] fix: add canary-tts back to SpeechModel --- speech.go | 1 + 1 file changed, 1 insertion(+) diff --git a/speech.go b/speech.go index 5c5d345ea..60e7694fd 100644 --- a/speech.go +++ b/speech.go @@ -10,6 +10,7 @@ type SpeechModel string const ( TTSModel1 SpeechModel = "tts-1" TTSModel1HD SpeechModel = "tts-1-hd" + TTSModelCanary SpeechModel = "canary-tts" TTSModelGPT4oMini SpeechModel = "gpt-4o-mini-tts" )