定制 ardagnsrn/elevenlabs-laravel 二次开发

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

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

ardagnsrn/elevenlabs-laravel

Composer 安装命令:

composer require ardagnsrn/elevenlabs-laravel

包简介

This is an Open Source Laravel package for ElevenLabs Text to Speech API.

README 文档

README

elevenlabs-js

ElevenLabs.io API for PHP Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is an Open Source PHP Laravel package for elevenlabs.io Text to Speech API. You can find the Official API document here: https://api.elevenlabs.io/docs

Buy me a coffee

Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)

Buy Me A Coffee

Table of Contents

Installation

You can install the package via composer:

composer require ardagnsrn/elevenlabs-laravel

You can publish the config file with:

php artisan vendor:publish --tag="elevenlabs-laravel-config"

This is the contents of the published config file:

return [
    'api_key' => env('ELEVENLABS_API_KEY'),
];

Supported Methods

Method Parameters EndPoint HTTP Method
textToSpeech() voiceId, text, modelId, voiceSettings /v1/text-to-speech/{voice_id}/stream POST
getModels() N/A /v1/models GET

Parameters

Parameter Type Description Required Default
voiceId String The ID of the voice to use. You can get a list of available voices using getVoices(). Yes N/A
text String The text to convert to speech. Yes N/A
modelId String The ID of the model to use. You can get a list of available models using getModels(). No eleven_multilingual_v2
voiceSettings Array The settings to use for the voice. No ['stability' => 0.95, 'similarity_boost' => 0.75, 'style' => 0.06, 'use_speaker_boost' => true]

Voice Settings

Parameter Type Description Default
stability Float The stability of the voice. 0.95
similarity_boost Float The similarity boost of the voice. 0.75
style Float The style of the voice. 0.06
use_speaker_boost Boolean Whether to use speaker boost or not. true

Usage

textToSpeech() Method

Generate a text to speech audio file. You can either save the file or get the pipe and do whatever you want with it.

$elevenLabs = new ArdaGnsrn\ElevenLabs();
$response = $elevenLabs->textToSpeech('YOUR_VOICE_ID', 'Hello World!', 'eleven_multilingual_v2', [
    'stability' => 0.95, 
    'similarity_boost' => 0.75, 
    'style' => 0.06, 
    'use_speaker_boost' => true
]);

// If you want, you can save to storage like this:
$response->saveFile('audio.mp3');

// Or you can get the response and do whatever you want with it:
$response->getResponse();

getModels() Method

Get a list of available models.

$elevenLabs = new ArdaGnsrn\ElevenLabs();
$models = $elevenLabs->getModels();

Testing

composer test

Other Languages

Also, you can find the other languages of this package here:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

ardagnsrn/elevenlabs-laravel 适用场景与选型建议

ardagnsrn/elevenlabs-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.08k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2023 年 11 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「ArdaGnsrn」 「elevenlabs-laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ardagnsrn/elevenlabs-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ardagnsrn/elevenlabs-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 ardagnsrn/elevenlabs-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 1
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-12