shreejalmaharjan-27/php-fakeyou

A PHP interface to interact with FakeYou APIs

dev-main 2023-05-26 05:25 UTC

This package is auto-updated.

Last update: 2024-10-26 08:43:13 UTC


README

A library to interact with FakeYou APIs

Usage

Install

composer require shreejalmaharjan-27/php-fakeyou

Import library

use Shreejalmaharjan27\PhpFakeyou\FakeYou;

Create Object

$api = new FakeYou();

(Optional) Login to your FakeYou account

$api->login('joe@example.com', '12345678');

Audio Generation

/**
 * @param string The message to be converted to audio
 * @param string The model to be used for the audio
 */
$audio = $api->audio('Hello world', 'TM:fxq6hnfc3rht');

Check If Audio has been generated

/**
 * @param string Job Token
 * @param string Type of Check (lipsync/audio)
 */
$check = $api->check($audio['inference_job_token'], 'tts');

var_dump($check);

LipSync Generation

$video = $api->lipsync('https://example.com/audio.wav', 'WT:fp46xr2zewkt7yv14ptbehb1fcnth');

Check if video has been generated

/**
 * @param string Job Token
 * @param string Type of Check (lipsync/audio)
 */
$check = $api->check($video['inference_job_token'], 'lipsync');

var_dump($check);