-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuploadRecord.php
More file actions
40 lines (32 loc) · 947 Bytes
/
uploadRecord.php
File metadata and controls
40 lines (32 loc) · 947 Bytes
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
<?php
include("includes.php");
?>
<html>
<head>
<?php include("head.php"); ?>
</head>
<body>
<?php
ini_set('display_errors', '1');
// ### create wav file on server
$file = $GLOBALS["HTTP_RAW_POST_DATA"];
// $filename = "records/".getUniqFileName().".wav";
$filename = "records/".getUniqFileName().".mp3";
if(file_put_contents($filename, $file) === false) die("ERREUR : Impossible d'enregistrer le fichier sur le serveur");
// ### send file to MC
// "type=audio/wav"
// $mediaId = api__sendUrlFile($filename, "audio/wav");
$mediaId = api__sendUrlFile($filename, "audio/mp3");
// ### delete file on server
//unlink($filename);
if(strlen($mediaId) < 1){
die("[error] L'api n'a pas retourné d'id ...");
}
// ### result
$_SESSION[UPLOAD]["mediaId"] = $mediaId;
//echo "Response from curl exec = ".$mediaId;
?>
<?php include("analytics.php"); ?>
<?php include("text-to-speech-toggle.php"); ?>
</body>
</html>