{"id":18887805,"url":"https://github.com/masterfermin02/php-audio-text-summary","last_synced_at":"2026-02-24T10:30:17.986Z","repository":{"id":96034733,"uuid":"598381075","full_name":"masterfermin02/php-audio-text-summary","owner":"masterfermin02","description":"PHP package speech to text (audio, recordings) and make a summary.","archived":false,"fork":false,"pushed_at":"2023-02-07T01:39:20.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-31T05:26:45.826Z","etag":null,"topics":["chatgpt","google-speech-to-text","php"],"latest_commit_sha":null,"homepage":"https://github.com/masterfermin02/php-audio-text-summary","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masterfermin02.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-07T01:35:20.000Z","updated_at":"2023-10-30T14:38:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccd57423-3492-4f84-9c47-4299a3f165ee","html_url":"https://github.com/masterfermin02/php-audio-text-summary","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterfermin02%2Fphp-audio-text-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterfermin02%2Fphp-audio-text-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterfermin02%2Fphp-audio-text-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masterfermin02%2Fphp-audio-text-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masterfermin02","download_url":"https://codeload.github.com/masterfermin02/php-audio-text-summary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859562,"owners_count":19708863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","google-speech-to-text","php"],"created_at":"2024-11-08T07:39:41.924Z","updated_at":"2026-02-24T10:30:17.912Z","avatar_url":"https://github.com/masterfermin02.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP audio to text summary\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/masterfermin02/vicidial-recording-transcription.svg?style=flat-square)](https://packagist.org/packages/masterfermin02/vicidial-recording-transcription)\n[![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)\n[![Total Downloads](https://img.shields.io/packagist/dt/masterfermin02/vicidial-recording-transcription.svg?style=flat-square)](https://packagist.org/packages/masterfermin02/vicidial-recording-transcription)\n\nPHP package speech to text (audio, recordings) and make a summary.\n\nThis 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)\n\n## Google Authentication\nPlease 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.\n\n## ChatGPT ApiKey\n[OpenAI Api](https://platform.openai.com/docs/api-reference/introduction)\n\n## Requirement\nRequires PHP 8.1+\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require masterfermin02/php-audio-text-summary\n```\n\n## Usage\n\n```php\nuse Google\\Cloud\\Speech\\V1\\RecognitionAudio;\nuse Google\\Cloud\\Speech\\V1\\RecognitionConfig;\nuse Google\\Cloud\\Speech\\V1\\RecognitionConfig\\AudioEncoding;\nuse DaimonDove\\Transcription\\Transcriber;\n\n$client = OpenAI::client('YOUR_API_KEY');\n$googleCredentials = ['credentials' =\u003e 'YOUR_GOOGLE_API_CREDENTAILS'];\n$speechToText = Transcriber::create($client, $googleCredentials);\n\n# The name of the audio file to transcribe\n$gcsURI = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw';\n\n# set string as audio content\n$audio = (new RecognitionAudio())\n    -\u003esetUri($gcsURI);\n    \n# The audio file's encoding, sample rate and language\n$config = new RecognitionConfig([\n    'encoding' =\u003e AudioEncoding::LINEAR16,\n    'sample_rate_hertz' =\u003e 16000,\n    'language_code' =\u003e 'en-US'\n]);\n\necho $speechToText-\u003erecognize($config, $audio)\n-\u003esummary();\n\n// Get others alternatives for tests\n$response = $speechToText-\u003egetRecognizeText();\n\n# Print most likely transcription\nforeach ($response-\u003egetResults() as $result) {\n    $alternatives = $result-\u003egetAlternatives();\n    $mostLikely = $alternatives[0];\n    $transcript = $mostLikely-\u003egetTranscript();\n    printf('Summary: %s' . PHP_EOL, $speechToText-\u003esummaryText($transcript));\n}\n```\n\n## You can also use a file resource\n```php\nuse Google\\Cloud\\Speech\\V1\\RecognitionConfig\\AudioEncoding;\nuse Google\\Cloud\\Speech\\V1\\RecognitionConfig;\nuse Google\\Cloud\\Speech\\V1\\StreamingRecognitionConfig;\nuse DaimonDove\\Transcription\\Transcriber;\n\n$recognitionConfig = new RecognitionConfig();\n$recognitionConfig-\u003esetEncoding(AudioEncoding::FLAC);\n$recognitionConfig-\u003esetSampleRateHertz(44100);\n$recognitionConfig-\u003esetLanguageCode('en-US');\n$config = new StreamingRecognitionConfig();\n$config-\u003esetConfig($recognitionConfig);\n\n$audioResource = fopen('path/to/audio.flac', 'r');\n\n$client = OpenAI::client('YOUR_API_KEY');\n$googleCredentials = ['credentials' =\u003e 'YOUR_GOOGLE_API_CREDENTAILS'];\n$speechToText = Transcriber::create($client, $googleCredentials);\n\necho $speechToText-\u003erecognizeAudioStream($config, $audioResource)-\u003esummary();\n\n$responses $speechToText-\u003egetRecognizeAudioStreamText();\n\nforeach ($responses as $element) {\n    // doSomethingWith($element);\n}\n```\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Fermin Perdomo](https://github.com/masterfermin02)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasterfermin02%2Fphp-audio-text-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasterfermin02%2Fphp-audio-text-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasterfermin02%2Fphp-audio-text-summary/lists"}