i have a file speakWord.php:
<?php
header("Content-Type: audio/mpeg");
$voice = file_get_contents('http://translate.google.com/translate_tts?tl=' . urlencode($_POST['language']) . '&q=' . urlencode($_POST['word']) . '');
?>
<audio controls="controls" autoplay>
<source src="<?php echo $voice; ?>" />
</audio>
Now i want to use jquery to load the result of this mp3 file and output it in a div:
$("#speakWord")
.load("speakWord.php", {
language: "nl",
word: "test"
});
When i check the source of the div, it becomes something weird like:
<source src="��@��#a�F(��y2i���Ǵ1�L A�@���'!D������8" �="">
I think the header information is lost in speakWord.php when loaded in a div, i think im missing a part..