locked
Play x-wav from URI, should I use audio tag? RRS feed

  • Question

  • Hi,

    I want to play a audio captcha in my app. I have a URI to a audio file that the content-type is "audio/x-wav". I have tried the audio tag element, like this:

    <audio controls="controls">
                    <source src="http://..." type="audio/x-wav">
                    Your browser does not support the audio element.
    </audio>

    This didn't work. I got "Error: Unsupported audio type or invalid file path". I built a html file and tested in google chrome and it worked.

    It is normal to "audio/x-wav" not be supported?

    If so, what's the alternative to play my audio captchas in "audio/x-wav" from a URI?

    Thanks

    Thursday, September 27, 2012 2:09 PM

All replies

  • Hello,

    We do support playback of RIFF formatted files with uncompressed PCM data and a handful of compressed audio types. However, in this case you are specifying "audio/x-wav". Keep in mind that the "x" prefix in the mime type indicates that this is a "non-standard" file format. Try using "audio/wav" or "audio/wave" instead.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, October 1, 2012 10:33 PM
    Moderator
  • Hi,

    I've tried many wav files and none worked. I've created some wav audio files with 8bit and 16bit with uncompressed PCM and none worked.

    Have you any sample wav file that works and that you can supply for test purpose?

    Thanks,

    Regards,

    Alexandre

    Tuesday, October 2, 2012 3:19 PM
  • Hi,

    The same file, with the same URI, works if I use javascript instead:

    var src = "http://...";
    var audio = new Audio(src);
    audio.load();
    audio.play();

    Why the HTML version don't work?

    Tuesday, October 2, 2012 4:52 PM