Icontem

File: examples/play.php

Recommend this page to a friend!
  Classes of Subin Siby  >  Francium JavaScript Voice Recorder  >  examples/play.php  >  Download  
File: examples/play.php
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Francium JavaScript Voice Recorder
Record user voice and encode it as MP3 or WAV
Author: By
Last change:
Date: 3 years ago
Size: 406 bytes
 

Contents

Class file image Download
<?php
/**
 * Get BLOB Data from Database and ouput
 */
if(isset($_GET['id'])){
  require_once __DIR__ . "/db.php";
  $sql = $dbh->prepare("SELECT `audio`, LENGTH(`audio`) FROM `uploads` WHERE `id` = ?");
  $sql->execute(array($_GET['id']));
  $result = $sql->fetch();

  $audio = $result[0];
  $size = $result[1];
  
  header("Content-Length: $size");
  header("Content-Type: audio/wav");
  echo $audio;
}