SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Mobile, AL
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Incorporating Audio files

    I would like to incorporate audio files on my website. I have incorporated image files with no problem, using the proper coding, as instructed by the book ("Build Your Own Website The Right Way Using HTML & CSS", by Ian Lloyd [copyright 2006], p 180). If this is the code for incorporating image files, what is the code for incorporating audio (.wma) files? Also PDF files?

    ex:
    <div class="galleryphoto">
    <img src="sample.jpg" width="283" height="400" />
    </div>
    Last edited by thedapperdad; Aug 29, 2009 at 12:20. Reason: It was incomplete

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,121
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    The simplest way is just to have a link to the file, like so:

    Code:
    <a href="audiofilename.wma">Click here to hear audio</a>
    The browser will then open the file in its own default audio player. Of course, if you want to include a fancy, customized audio or video player, more code will be involved.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Mobile, AL
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx Bro. That's one way of doing it. It worked rather well. However, is there another way to incorporate the file without the individual having to save it on their computer first? In other words, just be able to click on it and listen?

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can try to embed the sound:
    http://www.google.com/search?q=embedding+sounds

    It doesn't work for everyone though. MP3 files are more portable, because they can be played with Flash Player.

  5. #5
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by thedapperdad View Post
    Thanx Bro. That's one way of doing it. It worked rather well. However, is there another way to incorporate the file without the individual having to save it on their computer first? In other words, just be able to click on it and listen?
    You would need to embed it into something like Flash or Silverlight (or use a player which can locate and play the media format), the thing with audio files is that browsers by default do not have a generic way to simply embed and play items (probably in part due to people who try to play music in the background without the visitors permission - a very bad idea!), as for PDF you simply link to the file and the Adobe Reader the individual has installed will load within the browser, this is something you do not need to worry about

  6. #6
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •