Download the PHP package moe-mizrak/laravel-google-text-to-speech without Composer

On this page you can find all versions of the php package moe-mizrak/laravel-google-text-to-speech. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-google-text-to-speech

Laravel Gemini and Google Cloud Text-to-Speech API Package

Laravel package for integrating Gemini Text-to-Speech API and Google Cloud Text-to-Speech API

Requirements

Installation

You can install the package via composer:

You can publish the config file with:

Configuration

After publishing the configuration file, you can set your Google Cloud credentials and other settings in the config/laravel-google-text-to-speech.php file.

Published config file will look like this:

[!NOTE] If you are using Google Cloud Text-to-Speech API:

  • Go to the Google Cloud Console to create and download your service account credentials with proper permissions for Text-to-Speech API.
  • Save the downloaded JSON file and set its path in the config cloud.credentials field.

If you are using Gemini Text-to-Speech API:

  • Go to Google Cloud Console and select the project where Gemini API is enabled (or create a project).
  • Create a service account with the necessary roles to access Gemini API.
  • Add a new key on the Keys tab, which will be used in the config gemini.api_key field.

Usage

There are 2 drivers for Google Text-to-Speech API:

Gemini Text-to-Speech API is the newer and more advanced API (premium voices), while Google Cloud Text-to-Speech API is the traditional API.

[!NOTE] You can set the driver in the config file so that the package uses the desired API automatically

(You need to set credentials/api_key, and api_endpoint accordingly in the config file for the selected driver)

Synthesize Text

This is an example of how to use the synthesizeText method:

For Gemini Text-to-Speech API:

[!NOTE] Gemini Text-to-Speech API currently supports only .pcm audio format.

After saving the output as a .pcm file, you can convert it to other audio formats (like .wav or .mp3) using tools like ffmpeg.

[!TIP] Check GeminiVoiceData classes for more options.

For Cloud Text-to-Speech API:

[!TIP] Check CloudAudioConfigData classes for more options.

List Voices

This is an example of how to use the listVoices method:

[!WARNING] listVoices method only works with Google Cloud Text-to-Speech API. It is not supported for Gemini Text-to-Speech API.

Contributing

Your contributions are welcome! If you'd like to improve this project, simply create a pull request with your changes. Your efforts help enhance its functionality and documentation.

If you find this project useful, please consider ⭐ it to show your support!

Authors

This project is created and maintained by Moe Mizrak.

License

Laravel Package Template is an open-sourced software licensed under the MIT license.


All versions of laravel-google-text-to-speech with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
spatie/laravel-data Version ^4.17
google/cloud-text-to-speech Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moe-mizrak/laravel-google-text-to-speech contains the following files

Loading the files please wait ...