ken107 / read-aloud

An awesome browser extension that reads aloud webpage content with one click
https://readaloud.app
MIT License
1.31k stars 227 forks source link

Add voices from OpenAI #397

Closed MiniGod closed 1 month ago

MiniGod commented 1 month ago

The voices used in ChatGPT are the best I've ever used. They're available on their API (requires API key).

Guide: https://platform.openai.com/docs/guides/text-to-speech Reference: https://platform.openai.com/docs/api-reference/audio/createSpeech

Currently supports 6 different voices and 2 TTS models. And ton of different languages (inferred from input).

Example request from the docs:

curl https://api.openai.com/v1/audio/speech \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }' \
  --output speech.mp3
ken107 commented 1 month ago

Please right click the Read Aloud icon and choose Options. Then in the Voice dropdown, scroll to the bottom and choose "Enable Custom Voices". There you can enter your OpenAI API key to enable ChatGPT voices.

MiniGod commented 1 month ago

Ah, I see! I'm on Firefox and the published addon appears to be outdated there.

ken107 commented 1 month ago

Ah, indeed, I'll publish a releaase for Firefox. Thank you