-
Notifications
You must be signed in to change notification settings - Fork 1
/
tts_test.php
62 lines (52 loc) · 2.17 KB
/
tts_test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* *************************************************************************
* * OOHOO - TTS - Text To Speech **
* *************************************************************************
* @package block **
* @subpackage TTS **
* @name TTS **
* @copyright oohoo.biz **
* @link http://oohoo.biz **
* @author Ryan Thomas (Original Author) **
* @author Dustin Durand **
* @author Nicolas Bretin **
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later **
* *************************************************************************
* ************************************************************************ */
require_once('../../config.php');
global $CFG, $OUTPUT, $PAGE;
//Replace get_context_instance by the class for moodle 2.6+
if(class_exists('context_module'))
{
$context = context_system::instance();
}
else
{
$context = get_context_instance(CONTEXT_SYSTEM, 0);
}
require_login(1);
$PAGE->set_title('TTS Test Page');
$PAGE->set_url('/blocks/tts/tts_test.php');
$PAGE->navbar->add('TTS Test Page');
echo $OUTPUT->header();
$testgoogle = @get_headers("http://translate.google.com/translate_tts");
$testmicrosoft = @get_headers("http://api.microsofttranslator.com/V2/http.svc/Speak");
if($testgoogle === false)
{
echo 'Fail on retreiving information from Google server. Please check your server connectivity. (Apache server must have a gateway).<br/>';
}
else
{
echo 'There is no problem to access to the Google server.<br/>';
}
if($testmicrosoft === false)
{
echo 'Fail on retreiving information from Microsoft server. Please check your server connectivity. (Apache server must have a gateway).<br/>';
}
else
{
echo 'There is no problem to access to the Microsoft server.<br/>';
}
echo $OUTPUT->footer();
?>