outputAudioFile() публичный Метод

Output audio file with HTTP headers to browser $sound = new Securimage(); $sound->audio_format = 'mp3'; $sound->outputAudioFile();
С версии: 2.0
public outputAudioFile ( )
Пример #1
0
 /**
  *
  */
 public function outputAudioFile()
 {
     /**
      * @var $lng ilLanguage
      */
     global $lng;
     chdir(ilSecurImageUtil::getDirectory());
     if ($lng->lang_key != 'en' && in_array($lng->lang_key, self::$supported_audio_languages)) {
         $this->securimage->audio_path = $this->securimage->securimage_path . '/audio/' . $lng->lang_key . '/';
     }
     $this->securimage->outputAudioFile();
 }
Пример #2
0
 public function securimages_play()
 {
     $options = array('use_database' => true, 'database_name' => '', 'database_user' => '', 'database_driver' => Securimage::SI_DRIVER_MYSQL);
     $img = new Securimage();
     // Other audio settings
     //$img->audio_use_sox   = true;
     //$img->audio_use_noise = true;
     //$img->degrade_audio   = false;
     //$img->sox_binary_path = 'sox';
     // To use an alternate language, uncomment the following and download the files from phpcaptcha.org
     // $img->audio_path = $img->securimage_path . '/audio/es/';
     // If you have more than one captcha on a page, one must use a custom namespace
     // $img->namespace = 'form2';
     // set namespace if supplied to script via HTTP GET
     if (!empty($_GET['namespace'])) {
         $img->setNamespace($_GET['namespace']);
     }
     return $img->outputAudioFile();
 }
Пример #3
0
 * http://www.hotscripts.com/rate/49400.html  Thanks.
 *
 * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
 * @copyright 2012 Drew Phillips
 * @author Drew Phillips <*****@*****.**>
 * @version 3.5.2 (Feb 15, 2014)
 * @package Securimage
 *
 */
require_once dirname(__FILE__) . '/securimage.php';
// if using database, adjust these options as necessary and change $img = new Securimage(); to $img = new Securimage($options);
// see test.mysql.php or test.sqlite.php for examples
$options = array('use_database' => true, 'database_name' => '', 'database_user' => '', 'database_driver' => Securimage::SI_DRIVER_MYSQL);
$img = new Securimage();
// Other audio settings
//$img->audio_use_sox   = true;
//$img->audio_use_noise = true;
//$img->degrade_audio   = false;
//$img->sox_binary_path = 'sox';
// To use an alternate language, uncomment the following and download the files from phpcaptcha.org
// $img->audio_path = $img->securimage_path . '/audio/es/';
// If you have more than one captcha on a page, one must use a custom namespace
// $img->namespace = 'form2';
// set namespace if supplied to script via HTTP GET
if (!empty($_GET['namespace'])) {
    $img->setNamespace($_GET['namespace']);
}
$img->outputAudioFile();
 function play()
 {
     $phpcaptcha = new Securimage();
     $phpcaptcha->outputAudioFile();
     exit;
 }
Пример #5
0
 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
 * @copyright 2012 Drew Phillips
 * @author Drew Phillips <*****@*****.**>
 * @version 3.5.2 (Feb 15, 2014)
 * @package Securimage
 *
 */
require_once dirname(__FILE__) . '/securimage.php';
// if using database, adjust these options as necessary and change $img = new Securimage(); to $img = new Securimage($options);
// see test.mysql.php or test.sqlite.php for examples
$options = array('use_database' => true, 'database_name' => '', 'database_user' => '', 'database_driver' => Securimage::SI_DRIVER_MYSQL);
$img = new Securimage();
// Other audio settings
//$img->audio_use_sox   = true;
//$img->audio_use_noise = true;
//$img->degrade_audio   = false;
//$img->sox_binary_path = 'sox';
//Securimage::$lame_binary_path = '/usr/bin/lame'; // for mp3 audio support
// To use an alternate language, uncomment the following and download the files from phpcaptcha.org
// $img->audio_path = $img->securimage_path . '/audio/es/';
// If you have more than one captcha on a page, one must use a custom namespace
// $img->namespace = 'form2';
// set namespace if supplied to script via HTTP GET
if (!empty($_GET['namespace'])) {
    $img->setNamespace($_GET['namespace']);
}
// mp3 or wav format
$format = isset($_GET['format']) && strtolower($_GET['format']) == 'mp3' ? 'mp3' : null;
$img->outputAudioFile($format);
Пример #6
0
<?php

require_once 'helpers/Captcha.class.php';
$image = new Securimage();
$image->outputAudioFile();