Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Steven Masteller
Full Stack JavaScript Techdegree Student 16,652 PointsHTML5 Audio
I am trying to add audio to a page. This seems to work the best.
<audio src="Ocean_Surf.wav" autoplay id="loop-limited">
HTML5 audio not supported
</audio>
The id is for some javascript that shuts it off once it runs through twice.
Anyway, my problem is that it stutters. I tried the following;
<audio src="Ocean_Surf.wav" autoplay preload = "auto" id="loop-limited">
HTML5 audio not supported
</audio>
But, if anything it made matters worse because there was a large delay before playing and then it still stuttered. Any suggestions?
Steven Masteller
Full Stack JavaScript Techdegree Student 16,652 Points@brock Hmm... I had a look at your game and the audio on that is stuttering for me as well. Does it stutter for you? I think maybe the problem isn't the HTML code, but rather, the browser or my computer.
brock lynch
6,956 PointsI suppose if you have a lot going on with the client-side of things, it could cause it to stutter. I notice that in my game it stutters the most when the user has to enter in the answer to the riddle. I wouldn't think that a small script would be that intensive computationally or on the browser, but who knows. Think of it like this though, have you ever tried playing windows media player and doing another task on a relatively slow computer? Music requires a lot of bandwidth and probably CPU power as well.
brock lynch
6,956 Pointsbrock lynch
6,956 PointsThat's what I used recently to loop music for this game I made in javascript/jQuery on http://dodgemaster.brockswebdev.com
Update: Yeah, now that I hear it I guess it does kinda stutter at certain parts. I'm not sure why that is.