Email or username:

Password:

Forgot your password?
Simon Willison

I built a little browser-based tool for playing with the audio output from the OpenAI GPT-4o audio preview model - you can set a system prompt and a regular prompt, play the resulting audio, download the wav file and also export out the underlying JSON

Tool is here (you'll need to provide your own OpenAI API key, stored in localStorage): tools.simonwillison.net/openai

Notes on how I built it (with Claude) here: simonwillison.net/2024/Oct/28/

Screenshot of a text-to-speech interface showing a system prompt "Speak with a thick french accent, speaking fast", user prompt "Tell me all about pelicans, in just a sentence", voice dropdown set to "Alloy", audio player at 0:13/0:13, and generated text about pelicans: "Pelicans are large waterbirds with a distinctive pouch under their beak, known for their impressive fishing skills as they dive into the water to catch fish, often working together in groups to herd their prey." Also shows a Generate Speech button, Download Audio button, and partial API response with id "chatcmpl-ANBZcJi4DbN06f9i7z51Uy9SCVtZr" and object "chat.completion"
1 comment
Simon Willison

Bonus tool: if you save the raw API JSON as a Gist you can add the Gist ID to this URL to serve up a page that lets other people play back your audio

Here's my example with a system prompt specifying a "thick French accent":

tools.simonwillison.net/gpt-4o

Screenshot of an audio player interface. At the top is text explaining "Note: This player expects GitHub Gists containing JSON responses from the OpenAI GPT-4 with audio preview model (gpt-4o-audio-preview). The JSON should include an audio response with base64-encoded WAV data." Below is a text input field containing "https://gist.github.com/4a982d3fe7ba8cb4c01e89c69a4a5335" with a "Fetch" button. An audio player control bar shows 0:00/0:13 duration. There's a "Download Audio" button and text describing pelicans: "Pelicans are large waterbirds with a distinctive pouch under their beak, known for their impressive fishing skills as they dive into the water to catch fish, often working together in groups to herd their prey."
Go Up