OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
texttovoice
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/28/2024 11:03:35 AM
rwxrwxr-x
📄
broadcast.php
960 bytes
07/29/2024 04:43:31 AM
rw-r--r--
📄
processvoice.php
1.14 KB
07/29/2024 05:10:35 AM
rw-r--r--
Editing: processvoice.php
Close
<? include '../inc/validate.logged.php'; $timestamp = time(); if ((isset($_POST['title'])) && (isset($_POST['description']))) { $data = urldecode($_POST['title']) . "\n" . urldecode($_POST['description']); texttovoice($gUserId, $timestamp, $data); } function texttovoice($gUserId, $timestamp, $data) { $apiKey = "sk-proj-FrlWqCTIyid7DZGorv0uT3BlbkFJzqrUB0km57kpp4aFPNV7"; $url = "https://api.openai.com/v1/audio/speech"; $data = array( "model" => "tts-1", "input" => $data, "voice" => "alloy" ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "Authorization: Bearer $apiKey" )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $root = $_SERVER['DOCUMENT_ROOT'] . '/audio/_' . $gUserId . $timestamp . 'speech.mp3'; file_put_contents($root, $response); print_r('/audio/_' . $gUserId . $timestamp . 'speech.mp3'); }