I work for a company and am trying to make a new demo page. I would love to dumb down the page to exactly what is not working, but unfortunately it is tied to a variety of scripts on my server, as well as AJAX requests that have to go to the same domain name. I will describe the going ons as well as possible however.
Essentially, my session code is working almost as expected. This is not where the problems lie. The problem is that the audio played after doing a "Say It" button click works as expected in Chrome,but firefox plays only the first audio request, even after subsequent ones with different text, and nothing is played in internet explorer. The relevant code is all in the head section where a group of three functions control all of what is going on. formSubmit() is called when "Say It" button is hit, onAudioLoad() is called once the audio has been loaded, and limitText() does, well, it limits the amount of text people can put in.
So formSumbmit() sends an AJAX request to my server script which returns one of two things:
1) HTML5 audio tag with the source elements with correct src attributes or 2) A p element saying that your session has expired.
I am simply trying to get the audio to play without the horrible echo (which may or may not be caused by the actual mp3/ogg conversion software) and to have it work as expected on all browsers.
onAudioLoad sends a request to delete the audio, to avoid people stealing our product too easily :D
Expected behavior:
Whatever text is present in the demo text area will be sent server-side to be synthesized, and then the audio will be played through the client's speakers.
If you have any further questions I will be checking back here periodically.
Here is the URL of the demo:
http://www.cepstral.com/demos/temp/cepstral_tts_demo.php
Thank you for any and all help.
Ultimate Question:
Why does this work as expected in Chrome but not in Firefox 11 and IE9?
In firefox it will play only the first audio request.
In IE9 no audio is played.
I am aware that the audio is never going to be safe. We are just trying to make it more difficult for common users.
After trying to find out what was going on and having contact in chat (transcript) I've come to the following conclusion: it's an caching issue.
When trying to change text in FF and requesting a new soundfile it still plays the old sound. By checking the requests and responses it looks like you are always responding with the same filename (for the audiofile) although the sound itself is different.
When downloading that soundfile or opening it in a new tab and refresh it without cache it plays the correct sound (with the new text), so I'm pretty sure about the caching.
You should find out a way to return unique filenames for different texts to prevent browser playing the cached versions.
The same applies when testing it on IE on my machine.
EDIT by OP
Wanted to add that the reason it was not working on my IE appears to be that I am using Windows 7 N. Noted in the release notes for IE9 is the fact that Windows 7 N requires special updates to play HTML5 video. They do not mention HTML5 audio, but it is my assumption that this is the problem.