# Sloaner文字转语音工具 **Repository Path**: yushunliee/sloaner-text-to-speech-tool ## Basic Information - **Project Name**: Sloaner文字转语音工具 - **Description**: 一个功能完整的纯前端文字转语音工具,基于浏览器原生的 Web Speech API 实现,无需后端服务器。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-03 - **Last Updated**: 2025-09-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🎙️ 文字转语音工具 (Text-to-Speech Tool) 一个功能完整的纯前端文字转语音工具,基于浏览器原生的 Web Speech API 实现,无需后端服务器。 [English](#english) | [中文](#中文) ## 中文 ### ✨ 特性 - 🎯 **精确控制** - 支持语速、音调、音量的精细调节 - 🌍 **多语言支持** - 支持多种语言和方言的语音合成 - 💾 **离线下载** - 生成的语音可直接下载保存为WAV文件 - ⚡ **实时处理** - 无需等待,即时生成高质量语音 - 📱 **响应式设计** - 完美支持桌面和移动设备 - 🚀 **零依赖** - 纯前端实现,无需服务器或外部API - ⌨️ **快捷键支持** - 支持键盘快捷键操作 ### 🚀 快速开始 1. **直接使用** ```bash # 下载项目 git clone https://github.com/your-username/tts-tool.git cd tts-tool # 直接在浏览器中打开 index.html open index.html ``` 2. **在线使用** - 直接访问部署的在线版本 - 或者复制HTML代码到任何支持HTML的环境中 ### 📖 使用方法 1. **输入文本** - 在文本框中输入要转换为语音的内容 2. **选择语音** - 从下拉菜单中选择合适的语音(自动优先显示中文语音) 3. **调整参数** - 根据需要调整语速、音调、音量 4. **开始播放** - 点击播放按钮或使用快捷键 `Ctrl+Enter` 5. **下载音频** - 点击下载按钮保存生成的音频文件 ### ⌨️ 快捷键 - `Ctrl + Enter` - 开始播放 - `Ctrl + Space` - 暂停/继续播放 ### 🖥️ 浏览器兼容性 - ✅ Chrome 33+ - ✅ Firefox 49+ - ✅ Safari 7+ - ✅ Edge 14+ - ✅ Opera 21+ ### 📋 功能列表 - [x] 文字转语音合成 - [x] 多语言语音选择 - [x] 语速调节 (0.1x - 2.0x) - [x] 音调调节 (0 - 2.0) - [x] 音量调节 (0 - 1.0) - [x] 播放/暂停/继续/停止控制 - [x] 音频文件下载 - [x] 进度显示 - [x] 响应式界面 - [x] 键盘快捷键 - [x] 状态提示 ### 🛠️ 技术栈 - **Web Speech API** - 浏览器原生语音合成API - **MediaRecorder API** - 音频录制和下载 - **HTML5** - 现代Web标准 - **CSS3** - 响应式设计和动画 - **Vanilla JavaScript** - 无框架依赖 ### 📁 项目结构 ``` tts-tool/ ├── index.html # 主应用文件 ├── README.md # 项目说明文档 ├── LICENSE # 许可证文件 ├── CONTRIBUTING.md # 贡献指南 ├── CHANGELOG.md # 更新日志 └── docs/ # 文档目录 ├── screenshots/ # 截图 └── demo/ # 演示文件 ``` ### 🤝 贡献 欢迎提交Issue和Pull Request! 1. Fork 项目 2. 创建功能分支 (`git checkout -b feature/AmazingFeature`) 3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支 (`git push origin feature/AmazingFeature`) 5. 提交Pull Request 详细信息请参考 [CONTRIBUTING.md](CONTRIBUTING.md)。 ### 📄 许可证 本项目基于 MIT 许可证开源 - 查看 [LICENSE](LICENSE) 文件了解详情。 ### 🆘 支持 如果你觉得这个项目有用,请给它一个⭐! - 📧 邮箱:your-email@example.com - 💬 Issues:[GitHub Issues](https://github.com/your-username/tts-tool/issues) --- ## English ### ✨ Features - 🎯 **Precise Control** - Fine-tuning of speech rate, pitch, and volume - 🌍 **Multi-language Support** - Support for multiple languages and dialects - 💾 **Offline Download** - Download generated speech as WAV files - ⚡ **Real-time Processing** - Instant high-quality speech generation - 📱 **Responsive Design** - Perfect support for desktop and mobile devices - 🚀 **Zero Dependencies** - Pure frontend implementation, no server required - ⌨️ **Keyboard Shortcuts** - Support for keyboard shortcuts ### 🚀 Quick Start 1. **Direct Usage** ```bash # Download the project git clone https://github.com/your-username/tts-tool.git cd tts-tool # Open index.html in your browser open index.html ``` 2. **Online Usage** - Visit the deployed online version - Or copy the HTML code to any HTML-supported environment ### 📖 How to Use 1. **Input Text** - Enter the text to be converted to speech in the text box 2. **Select Voice** - Choose an appropriate voice from the dropdown (Chinese voices are prioritized) 3. **Adjust Parameters** - Adjust speech rate, pitch, and volume as needed 4. **Start Playing** - Click the play button or use `Ctrl+Enter` shortcut 5. **Download Audio** - Click the download button to save the generated audio file ### ⌨️ Keyboard Shortcuts - `Ctrl + Enter` - Start playback - `Ctrl + Space` - Pause/Resume playback ### 🖥️ Browser Compatibility - ✅ Chrome 33+ - ✅ Firefox 49+ - ✅ Safari 7+ - ✅ Edge 14+