定制 innovination/elevenlabs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. Import the package into your PHP file:
use Innovination\Elevenlabs;
  1. Create an instance of the Elevenlabs class:
$elevenlabs = new ElevenLabs();
  1. Add ElevenLabs API key to your .env file
XI_API_KEY='your-api-key'
  1. 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

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-21