Forums

How to play/embed WMA audio file on website?

Trying to just put a simple WMA audio file from laptop onto webpage, where it can be embedded and played

Can't get it working, most online tutorials offer this kind of code:

<object id="MediaPlayer" height=46 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

<param name="filename" value="http://yourdomain.com/youraudio.mp3">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">

<embed type="application/x-mplayer2" src=" http://yourdomain.com/youraudio.mp3" name="MediaPlayer"></embed>

</object>

except this doesn't do anything when inserted into the html

any pointers? thanks

According to the Wikipedia entry: "Microsoft dropped ActiveX support from the Windows Store edition of Internet Explorer 10 in Windows 8. In 2015 Microsoft released Microsoft Edge, the replacement for Internet Explorer with no support for ActiveX, this marked the end of the technology in Microsoft's web browser development." Other browser have discontinued ActiveX support many years ago. Any tutorial that uses ActiveX is hopelessly out of date.

The HTML 5 spec includes support for media: https://www.w3schools.com/html/html5_audio.asp

I've tried this on the site:

<audio controls>

<source src="file_example_WAV_1MG.wav" type="audio/wav">

Your browser does not support the audio element.

</audio>

this brings up the html on to https://madmartin.pythonanywhere.com/music

yet doesn't play anything

tried turning off all forms of 'blocking' on browser (Firefox) yet still won't play - I've put the music file in templates which is same as music.html file

if I use the exact same code on laptop html file it plays

any ideas? thanks

Have you checked the browser's debug console? If (for example) there's a problem with loading up the sound file, you'll see a message there when you try to play it explaining what the issue is.

yep I've looked at that, there seems to be some kind of browser related js type issues to deal with

I'll dig around a little online in that area