Try something like this:
varSoundFileName = "001.mp3";
varFilePath = Substitute( GetAsURLEncoded ( "file:///Volumes" & Get ( DesktopPath ) & varSoundFileName ); [ "%2F"; "/" ] )
"<audio controls=\"controls\"><source src=\"" & varFilePath & "\" type=\"audio/mp3\" /></audio>"
I changed audio format to mp3 simply because I already had something on the desktop that I could use to test, but it was an mp3 file...
HTH & best,
I appreciate your prompt reply, Steve. My file is m4a and it works as well. Thanks.
Beautiful. Thanks for letting me know how it turned out.
Now, I have the same audio file in the FMGo Documents directory. I got it there by exporting it using Get ( DocumentsPath). I can see it under "Files on Device."
However, the webviewer says "Cannot play audio file." Is there a different path format on the iOS?
This is how it looks in my device.
<audio controls="controls"><source src="file:///var/mobile/Applications/A202372C0-1ACA-47DD-B4DF-DDAS28A9SDFB/Documents/sound.m4a" /></audio>
I believe that what you are probably running into is a security limitation which is built into the iOS appkit, i.e. the webviewer is being denied access to a local file on the iOS device.
I poked around a little bit to see if I could find a definitive apple reference to cite for you, but could not find one in the quick googling that I did.
I did find a few forum threads, however, where people are discussing this sort of issue.
Examples of such threads:
Yes, that makes sense.
I can just export the audio file to the temporary directory and open it, which plays it.
But it was good to experiment with the webviewer and understand the limitations on iOS.