Skip to content

Commit

Permalink
Add elevenlabs-tts extension (#16140)
Browse files Browse the repository at this point in the history
* Add elevenlabs-tts extension

- chore: apply changes from Raycast collaborator (#28)
- fix: check file exists before cleanup (#27)
- fix: show error toast for invalid ElevenLabs API key (#26)
- refactor: use auto-generated Raycast preference types (#25)
- docs: move images to images/ folder (#24)
- docs: update README (#23)
- docs: add changelog (#22)
- feat: add Node.js version management and CI unit testing workflow (#21)
- security: bump cross-spawn to 7.0.6 (#20)
- fix: removes refs to default hotkey (#19)
- fix: refactor into separate files (#18)
- fix: add more comments (#17)
- fix: add unit tests (#16)
- fix: refactor into AudioManager (#15)
- fix: remove \'play-sound\' dependency (#14)
- Revert "fix: refactor into separate files (#10)" (#13)
- Revert "fix: add more README instructions (#11)" (#12)
- fix: add more README instructions (#11)
- fix: refactor into separate files (#10)
- feat: rename extension to \'ElevenLabs TTS\' (#9)
- fix: update extension icon (#8)
- fix: run prettier (#7)
- fix: pin dependencies (#6)
- fix: add more comments (#5)
- fix: add more logging and error handling (#4)
- fix: use websockets for faster TTS streaming (#3)
- fix: add toasts for UI feedback (#2)
- feat: use elevenlabs for TTS since it\'s better (#1)
- initial commit

* Update CHANGELOG.md

* Update CHANGELOG.md and optimise images

---------

Co-authored-by: Per Nielsen Tikær <[email protected]>
Co-authored-by: raycastbot <[email protected]>
  • Loading branch information
3 people authored Jan 12, 2025
1 parent da43b8c commit 8cac3e2
Show file tree
Hide file tree
Showing 23 changed files with 6,150 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensions/elevenlabs-tts/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"extends": ["@raycast"]
}
13 changes: 13 additions & 0 deletions extensions/elevenlabs-tts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# Raycast specific files
raycast-env.d.ts
.raycast-swift-build
.swiftpm
compiled_raycast_swift

# misc
.DS_Store
1 change: 1 addition & 0 deletions extensions/elevenlabs-tts/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.7.3
4 changes: 4 additions & 0 deletions extensions/elevenlabs-tts/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"singleQuote": false
}
26 changes: 26 additions & 0 deletions extensions/elevenlabs-tts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Raycast ElevenLabs TTS Changelog

## [1.0.0] - 2025-01-12

### Added
- Text-to-speech conversion using ElevenLabs API
- Support for multiple premium AI voices
- Voice customization with stability and similarity boost settings
- Automatic playback control (stop/start)
- Progress feedback with word count and text preview
- Error handling with user-friendly messages
- Automatic cleanup of temporary audio files

### Features
- Speak selected text from any application
- Configure voice settings through preferences
- Stop playback by running command again
- Support for long-form text
- Real-time audio streaming

### Technical
- WebSocket-based streaming for efficient audio delivery
- Temporary file management for audio chunks
- Event-based architecture for audio processing
- Comprehensive error handling and user feedback
- Unit tests for core functionality
73 changes: 73 additions & 0 deletions extensions/elevenlabs-tts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# ElevenLabs TTS for Raycast

🎙️ Transform any text into natural-sounding speech instantly with ElevenLabs' premium AI voices - right from your Raycast!

[Watch Demo](https://www.loom.com/share/d340fc09e88c47f1a032c0da291f3cc3)

![Voice Selection](./images/readme/voice-selection-dropdown.png)
![Extension Setup](./images/readme/elevenlabs-settings-screen.png)

## ✨ Features

- 🚀 Instant text-to-speech conversion with a simple keyboard shortcut
- 🎭 20+ premium AI voices with unique personalities and accents
- 🎛️ Fine-tune voice stability and clarity to match your needs
- 🔊 Real-time streaming playback
- ⚡️ Zero configuration needed - just add your API key and go!

## 🚀 Quick Start

1. Install from Raycast Store
2. Add your ElevenLabs API key ([Get one here](https://elevenlabs.io))
3. Set up your preferred hotkey in Raycast (⌘ + ,)
4. Pick your favorite voice and start speaking!

## 📋 Requirements

- Raycast v1.50.0+
- ElevenLabs API key
- macOS 10.15+

## Usage

1. Select any text in any application
2. Press your configured hotkey (e.g., ⌘ + Shift + S)
3. The selected text will be read aloud
4. Press the same hotkey again to stop playback at any time

💡 **Important**: By default, no hotkey is assigned. You'll need to:

1. Open Raycast Settings (⌘ + ,)
2. Go to Extensions
3. Find "Speak Selected Text"
4. Click "Add Hotkey" to set your preferred keyboard shortcut

## ⚙️ Advanced Settings

- **Stability** (0.0 - 1.0): Controls voice consistency. Higher values make the voice more stable but potentially less expressive.
- **Similarity Boost** (0.0 - 1.0): Adjusts how closely the output matches the original voice. Higher values increase similarity but may impact performance.

## 💡 Pro Tips

- Use shorter text segments for faster response times
- Experiment with different stability settings for each voice to find your perfect balance
- The extension works with any text-based application including browsers, editors, and documents

## 🔍 Troubleshooting

- If no sound plays, check your API key and internet connection
- Ensure you have sufficient credits in your ElevenLabs account
- For long texts, consider breaking them into smaller segments

## 🤝 Contributing

Found a bug or have a feature request? Please open an issue on GitHub!

## 📝 License

MIT License - feel free to use and modify as needed.

## 🙏 Credits

- [ElevenLabs](https://elevenlabs.io) for their amazing Text-to-Speech API
- [Raycast](https://raycast.com) for the excellent extension platform
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions extensions/elevenlabs-tts/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
}
Loading

0 comments on commit 8cac3e2

Please sign in to comment.