Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/audio-text-to-speech/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ func main() {
ctx := context.Background()

res, err := client.Audio.Speech.New(ctx, openai.AudioSpeechNewParams{
Model: openai.SpeechModelTTS1,
Model: openai.SpeechModelGPT4oMiniTTS,
Input: `Why did the chicken cross the road? To get to the other side.`,
ResponseFormat: openai.AudioSpeechNewParamsResponseFormatPCM,
Voice: openai.AudioSpeechNewParamsVoiceAlloy,
})
defer res.Body.Close()

if err != nil {
panic(err)
}

defer res.Body.Close()

op := &oto.NewContextOptions{}
op.SampleRate = 24000
op.ChannelCount = 1
Expand Down