2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2005 by Greg Gay */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
13 // $Id: play_voice.php 5123 2005-07-12 14:59:03Z greg
15 // This file is required to prevent browsers from caching content of
16 // TTS files if they were to access speech file directly through a URL
19 define('AT_INCLUDE_PATH', '../../../include/');
21 require (AT_INCLUDE_PATH.'vitals.inc.php');
23 define('AT_SPEECH_TEMPLATE_URL', $_base_href.'content/template/'.$_SESSION['lang'].'/');
25 if(strstr($_GET['play_voice'], '.mp3')){
27 header('Content-type: audio/x-mp3');
29 }else if(strstr($_GET['play_voice'], '.ogg')){
31 header('Content-type: audio/x-ogg');
35 header('Content-Disposition: inline; filename="'.str_replace("-","/",AT_SPEECH_TEMPLATE_URL).$_GET['play_voice'].'"');
36 readfile(AT_SPEECH_TEMPLATE_URL.$_GET['play_voice']);