%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/komfo908/api.komforthousesofas.com/karla/
Upload File :
Create Path :
Current File : /home/komfo908/api.komforthousesofas.com/karla/formulario_karla.html

<!DOCTYPE html>
<html lang="pt-br">
<head>
  <meta charset="UTF-8">
  <title>Assistente de Áudio com IA</title>
  <style>
    body { font-family: Arial, sans-serif; padding: 20px; background: #f9f9f9; }
    h2 { color: #A24E01; }
    .resultado { background: #fff; border: 1px solid #ccc; padding: 15px; margin-top: 20px; border-radius: 6px; }
    .label { font-weight: bold; margin-top: 10px; color: #333; }
    textarea { width: 100%; height: 120px; margin-top: 8px; }
  </style>
</head>
<body>
  <h2>Envie um áudio para o Assistente Karla 🎙️</h2>

  <form id="audioForm" enctype="multipart/form-data">
    <input type="file" name="audio" accept=".mp3,.wav" required>
    <br><br>
    <button type="submit">Enviar</button>
  </form>

  <div class="resultado" id="resultado" style="display:none;">
    <div class="label">📝 Transcrição:</div>
    <textarea id="transcricao" readonly></textarea>

    <div class="label">💬 Resposta da IA:</div>
    <textarea id="resposta" readonly></textarea>
  </div>

  <script>
    document.getElementById("audioForm").addEventListener("submit", function(event) {
      event.preventDefault();
      const form = event.target;
      const formData = new FormData(form);

      fetch("chat_audio.php", {
        method: "POST",
        body: formData
      })
      .then(res => res.json())
      .then(data => {
        if (data.transcricao && data.resposta) {
          document.getElementById("transcricao").value = data.transcricao;
          document.getElementById("resposta").value = data.resposta;
          document.getElementById("resultado").style.display = "block";
        } else {
          alert("Erro ao processar o áudio.");
        }
      })
      .catch(() => {
        alert("Erro de comunicação com o servidor.");
      });
    });
  </script>
</body>
</html>

Zerion Mini Shell 1.0