PHPackages                             masterfermin02/php-audio-text-summary - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. masterfermin02/php-audio-text-summary

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

masterfermin02/php-audio-text-summary
=====================================

PHP package to transcribe recordings or audio to text and summary using google speech to text and chatGPT

v1.0.0(3y ago)114MITPHPPHP ^8.1

Since Feb 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/masterfermin02/php-audio-text-summary)[ Packagist](https://packagist.org/packages/masterfermin02/php-audio-text-summary)[ Docs](https://github.com/masterfermin02/php-audio-text-summary)[ RSS](/packages/masterfermin02-php-audio-text-summary/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

PHP audio to text summary
=========================

[](#php-audio-to-text-summary)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b5b098cb33a7be92e4e7939e0ff40a9c72061886a6160cf1ac39b3fa0f1aa9ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61737465726665726d696e30322f766963696469616c2d7265636f7264696e672d7472616e736372697074696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masterfermin02/vicidial-recording-transcription)[![Tests](https://github.com/masterfermin02/vicidial-recording-transcription/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/masterfermin02/vicidial-recording-transcription/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/70fcbdd78bb71b1b16f98e393ba6c65d9ba693797a17af6569c824d8868265cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61737465726665726d696e30322f766963696469616c2d7265636f7264696e672d7472616e736372697074696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masterfermin02/vicidial-recording-transcription)

PHP package speech to text (audio, recordings) and make a summary.

This package is using the [OpenAI](https://github.com/openai-php/client) and [Google cloud speech to text](https://github.com/googleapis/google-cloud-php-speech)

Google Authentication
---------------------

[](#google-authentication)

Please see our [Authentication](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.

ChatGPT ApiKey
--------------

[](#chatgpt-apikey)

[OpenAI Api](https://platform.openai.com/docs/api-reference/introduction)

Requirement
-----------

[](#requirement)

Requires PHP 8.1+

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require masterfermin02/php-audio-text-summary
```

Usage
-----

[](#usage)

```
use Google\Cloud\Speech\V1\RecognitionAudio;
use Google\Cloud\Speech\V1\RecognitionConfig;
use Google\Cloud\Speech\V1\RecognitionConfig\AudioEncoding;
use DaimonDove\Transcription\Transcriber;

$client = OpenAI::client('YOUR_API_KEY');
$googleCredentials = ['credentials' => 'YOUR_GOOGLE_API_CREDENTAILS'];
$speechToText = Transcriber::create($client, $googleCredentials);

# The name of the audio file to transcribe
$gcsURI = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw';

# set string as audio content
$audio = (new RecognitionAudio())
    ->setUri($gcsURI);

# The audio file's encoding, sample rate and language
$config = new RecognitionConfig([
    'encoding' => AudioEncoding::LINEAR16,
    'sample_rate_hertz' => 16000,
    'language_code' => 'en-US'
]);

echo $speechToText->recognize($config, $audio)
->summary();

// Get others alternatives for tests
$response = $speechToText->getRecognizeText();

# Print most likely transcription
foreach ($response->getResults() as $result) {
    $alternatives = $result->getAlternatives();
    $mostLikely = $alternatives[0];
    $transcript = $mostLikely->getTranscript();
    printf('Summary: %s' . PHP_EOL, $speechToText->summaryText($transcript));
}
```

You can also use a file resource
--------------------------------

[](#you-can-also-use-a-file-resource)

```
use Google\Cloud\Speech\V1\RecognitionConfig\AudioEncoding;
use Google\Cloud\Speech\V1\RecognitionConfig;
use Google\Cloud\Speech\V1\StreamingRecognitionConfig;
use DaimonDove\Transcription\Transcriber;

$recognitionConfig = new RecognitionConfig();
$recognitionConfig->setEncoding(AudioEncoding::FLAC);
$recognitionConfig->setSampleRateHertz(44100);
$recognitionConfig->setLanguageCode('en-US');
$config = new StreamingRecognitionConfig();
$config->setConfig($recognitionConfig);

$audioResource = fopen('path/to/audio.flac', 'r');

$client = OpenAI::client('YOUR_API_KEY');
$googleCredentials = ['credentials' => 'YOUR_GOOGLE_API_CREDENTAILS'];
$speechToText = Transcriber::create($client, $googleCredentials);

echo $speechToText->recognizeAudioStream($config, $audioResource)->summary();

$responses $speechToText->getRecognizeAudioStreamText();

foreach ($responses as $element) {
    // doSomethingWith($element);
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Fermin Perdomo](https://github.com/masterfermin02)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17c416be607cbb47c55e76e115e3c35c3d74906ff422e808e4bba3be1dfb5cd6?d=identicon)[masterfermin02](/maintainers/masterfermin02)

---

Tags

chatgptgoogle-speech-to-textphpmasterfermin02php-audio-text-summary

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/masterfermin02-php-audio-text-summary/health.svg)

```
[![Health](https://phpackages.com/badges/masterfermin02-php-audio-text-summary/health.svg)](https://phpackages.com/packages/masterfermin02-php-audio-text-summary)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k409.0k6](/packages/theodo-group-llphant)[maestroerror/laragent

Power of AI Agents in your Laravel project

639159.9k](/packages/maestroerror-laragent)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

3017.9k](/packages/mage-os-module-automatic-translation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
