I have been researching into using PHP and Javascript to communicate with each other on the same page.
Firstly I have a php script at the top with a function to retrieve a audio from an AWS Ivona media stream.
<?php
function createAndPlay($text){
// request service get response save to `$data`
// I want this to then play the sound
}
?>
<script>
// when button clicked createAndPlay("Text to Speak")
<script>
I would like this to be done on the same page WITHOUT starting when the body of the document is first loaded.