I am making a talking bot atm. But sound files overtaking each other. They playing at the same time. I can't handle this. How can i play them in order, when one finishes, then another should play... Then my bot could talk... Can you give me an example of code please? Thanks...
Here is my code...
What i want is, the audio should tell me "Meh" or something like that. I want it to be talking...
Thanks!
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form action="" method="post">
<input name="deger" type="text" value="">
<input type="submit">
</form>
<?php
$m="m";
$e="e";
$r="r";
$h="h";
$a="a";
$b="b";
if (strpos($_POST["deger"], $m) !== false) {
echo "<script>var birdSound = new Audio('m.wav');
birdSound.loop = false;
birdSound.play();
</script>";
}
//
if (strpos($_POST["deger"], $e) !== false) {
echo "<script>var birdSound = new Audio('e.wav');
birdSound.loop = false;
birdSound.play();
</script>";
}
//
if (strpos($_POST["deger"], $h) !== false) {
echo "<script>var birdSound = new Audio('h.wav');
birdSound.loop = false;
birdSound.play();
</script>";
}
?>
</body>
</html>