<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://audio.dubverse.ai/api/tts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Welcome to Dubverse AI. Convert your text to lifelike speech with our advanced AI models.',
'speaker_no' => 1190,
'config' => [
'use_streaming_response' => false,
'sample_rate' => 22050,
'instructions' => '<string>'
],
'callback_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}