PHP code snippets that provide insight into building voice biometric registration and verification into a PHP-based application.
The following PHP sample code provides insight into building voice registration and verification into a PHP-based application. The code includes all of the steps up to the submission of an utterance (a recorded audio file).
Configuration and helper functions
Note that you need to insert your developer credentials (
VV_USERNAME, etc) that you will have received when you self-registered for Fusion Enterprise.
Received valid ClaimantID: secs) Error during RegisterClaimant: “)
Voice enrollment – STEP 2 (Start new dialogue with new claimant)
The second step is to start a new session (
Dialogue) with the system for this person using their
Received valid DialogueID: secs) Dialogue type (ProcessType): " Error during StartDialogue: ")
Voice enrollment – STEP 3 (Start enrollment utterance submission)
The third step is to capture the audio phrase requested (
PromptHint) for this user and submit it using this
<?php // Call SubmitPhraseBase64 to submit the audio phrase $params = array( 'dialogue_id' => $dialogue_id, // this identifies dialogue currently in use 'prompt' => $prompt_hint, 'format' => "Unknown" // should be identified by header for the example WAV ); // add the audio from an example file for this demo, convert to base64 $filename_wav = "…"; // insert correct filename of captured audio here!!! $audio_binary = fread(fopen($filename_wav, "r"), filesize($filename_wav)); $params['utterance'] = base64_encode($audio_binary); $results = call_vvwsmethod( 'SubmitPhraseBase64', $params ); // TO DO: // CHECK STATUS AND REPEAT STEP 3 SUBMISSIONS UNTIL REQUIRED // NUMBER OF SUCCESSFUL UTTERANCES CAPTURED