/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Valid Way of adding audio playback to webpage?

Is there a way to embed a WAV playback to an HTML 4.01 webpage that will be considered valid by the W3 validator? Or do I have to go HTML5 and use <audio>?

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@Mr_Initial_ManauthorNov 30.2014 — Forgot about the <object> tag, which works fine and dandy for everything but Internet Explorer--which doesn't like .WAV files. Add in that I'm throwing 100 sound files onto a webpage and....

Yeah. This might not work. What do you guys think? Too much loading?
Copy linkTweet thisAlerts:
@Stephen_PhilbinDec 02.2014 — A few months ago, II had a stab at making a page with XHTML 1.1 that contained audio files. it's been quite a few years since I tried anything like that and, in the end, I I just couldn't seem to manage to get audio files on the page in the way I wanted (with a play/pause button), keep the markup valid, and have them all [b]not[/b] start playing on page load. I was sure that, when I was trying to do something similar several years ago, I couldn't get them to start playing without requiring the user to press play first. This year, though, I was having the opposite problem. As soon as the page loaded a cacophony began of about 7 songs all playing at the same time.

In the end I gave up ad thought that if it can't do it with valid markup, then it might as well be properly invalid and just have a stab at doing it with HTML 5 (which wasn't a proper Recommendation at the time). Though I haven't yet gone back to HTML 5 to look at how exactly valueless attributes are supposed to work when using HTML as an application of XML. I'd be amazed if the short answer isn't "they don't", because of XML's well-formedness constraints. But i'd be interested to see what the work-around is.

That'll have to wait a little while though, 'cause my own—disastrously ugly—site has been patiently waiting for a face-lift for some years and I'm finally going to get on with it.

Or, at least, that's the plan.

Your page loaded for me before I even had time to switch to the tab, though. ?
Copy linkTweet thisAlerts:
@Sup3rkirbyDec 02.2014 — I don't want to look too much like a fool here, but what about the actual [B]<embed>[/B] tag? From what I've read [B]<object>[/B] is great for everything but IE, however [B]<embed>[/B] typically does work in IE for .wav files, so long as there is a plugin associated with .wav files on the computer. I've seen [B]<embed>[/B] used as a fallback inside of the [B]<object>[/B] tag so IE users still get playback.

I could have no idea what I'm talking about here, but I thought I'd just share my findings on the matter.
Copy linkTweet thisAlerts:
@Stephen_PhilbinDec 02.2014 — I don't want to look too much like a fool here, but what about the actual [B]<embed>[/B] tag?[/QUOTE]

Never be afraid of asking questions. If you don't ask the question, you'll never get the answer and never learn.

In the cases were discussing here, <embed> tag is not an option because HTML 4.01 and XHTML 1.1 do not have <embed> tags. Years ago, when HTML 4.01 was more-or-less the only option available to HTML authors, there was a problem that was very difficult to work around. I think it was Netscape that came up with the idea of an embed tag. If memory serves me correctly, they just rammed this thing into their Netscape Navigator browser without consulting anyone from the ol' [url=www.w3.org]W3[/url]. This let authors shove all manner of things in their pages that they couldn't do before. Other browser manufacturers saw that users would also want/expect this functionality it their browsers and that, if they didn't follow suit, users would be likely to switch to Netscape Navigator. So <embed> quickly became a de facto standard. However, because it was brought about by self-interested corporations, rather than an independent organisation, it wasn't a standardised standard that had clearly defined functions and features. So, because it was never part of HTML 4.01, any web page that used it was [i]invalid[/i]. Meaning it is improperly standardised and is under no obligation to work properly (or even at all) in a web browser.

Now that HTML 5 is out, however, it has finally been properly and formally standardised in [url=http://www.w3.org/TR/html5/]the HTML 5 Recommendation[/url]. This, mercifully, makes creating valid web pages that contain other media such as Flash objects, audio files and PDFs [b][u]much[/u][/b] easier, or in many cases even possible.

One for the history books. Thankfully. ?
×

Success!

Help @Mr_Initial_Man spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...