innovination/elevenlabs
最新稳定版本:1.0.2
Composer 安装命令:
composer require innovination/elevenlabs
包简介
A simple package to convert text to audio using Elevenlabs API and store it in the storage.
README 文档
README
This Composer package allows you to convert text into audio using the ElevenLabs API.
Installation
To install this package, you can use Composer. Run the following command in your project directory:
composer require innovination/elevenlabs
Usage
To use this package, follow these steps:
- Import the package into your PHP file:
use Innovination\Elevenlabs;
- Create an instance of the
Elevenlabsclass:
$elevenlabs = new ElevenLabs();
- Add ElevenLabs API key to your
.envfile
XI_API_KEY='your-api-key'
- Convert text to audio:
//Required $elevenlabs->voice_id = 'voice-id-on-elevenlabs'; $elevenlabs->text = "Hello, world!"; //Optional $elevenlabs->file_prefix = "prefix"; // default is audio $elevenlabs->path = "folder-name"; //default folder is audio $audioFile = $elevenlabs->generateAudio();
The generateAudio method will return the path to the generated audio file along with status as sucess or error
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-21