mmuodev / microsoft-azure-cognitive-php
PHP Wrapper for Microsoft Azure Cognitive Services
dev-master
2020-06-15 16:34 UTC
Requires
- guzzlehttp/guzzle: ^6.5
- vlucas/phpdotenv: ^4.1
This package is auto-updated.
Last update: 2025-06-20 00:20:20 UTC
README
A PHP Wrapper for Microsoft Azure Cognitive Services
- Run Composer install to install packages
- Copy .env.example to .env and set the appropriate values.
- For speaker verification, you can get the SPEECH_KEY and SPEECH BASE_URL from your Microsoft Azure acccount.
Speaker Verification
- Install FFMPEG To allow you convert audio files to wav format. For ubuntu, sudo apt install ffmpeg. See https://ffmpeg.org/
- Initiate a Speech object
- $speaker = new Speech()
- Create Verification Profile
- $speaker->createVerificationProfile()
- Enrol a Verification Profile
- $speaker->enrolVerificationProfile($audio, $verification_id)
- $audio is the audio file in wav format and $verification_id is the id of the speaker
- To convert to wav format, $speaker->convertAudio($audio)
- Verify Speaker
- $speaker->verifySpeaker($audio, $verification_id)
- $audio is the audio file in wav format and $verification_id is the id of the speaker
- To convert to wav format, $speaker->convertAudio($audio)
##Details Microsoft Azure Speaker Recognition can be found here: https://azure.microsoft.com/en-us/services/cognitive-services/speaker-recognition/