Skip to content

This Laravel package converts text to audio using Elevenlabs and uploads the generated file to your Storage

Notifications You must be signed in to change notification settings

viditgoyal3009/elevenlabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-to-Audio Composer Package

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

About

This Laravel package converts text to audio using Elevenlabs and uploads the generated file to your Storage

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages