1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Midi Music on web pages

Discussion in 'Web Design & Development' started by wolfworx, Oct 27, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    Recently noticed a problem with some of my website pages playing midi music. These are urls that have played the selections properly in the past. There has been no change in the html coding. I have been using lines similar to the following.

    <embed src="addams2.mid" loop="-1" width="72" height="54" hidden>

    I have discovered the problem on several computers using both Firefox and ie. Sometime the page will play and other times not.

    On one url three pages play and one does not, but on another computer all four play and on a third none play.

    Yes I have checked the sound output on all three computers.

    Could this problem be the server at my site provider?

    To repeat: This music played in the past and I have not modified the code.
     
  2. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    Probably not much help, but if the HTML hasn't changed, then maybe something else has, like security updates in the browser or the firewall settings.

    I have noticed, for example, that images may fail to load on some web pages when changes are made in the connection settings, like the MTU or receive window. Anything like that changed lately?
     
  3. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    No such change that I am aware of. Also I have just tried on a fourth computer. It produced the music at the site in the past but now, nada.
     
  4. sepala

    sepala

    Joined:
    May 20, 2010
    Messages:
    4,038
    Agree with others. Apart from that, modern browsers have more support to HTML 5 AUDIO tag, rather than this.
     
  5. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    Problem is standards and consistency. When you create a web page you need that features work for a reasonable percentage of the visitors. I had to go back and eliminate hover buttons on my web site because not all visitors could use them.

    regarding this code:

    <style type="text/css">


    .image-swap-1 {
    width: 256px;
    height: 256px;
    position: relative;
    padding: 0;
    margin: 0;
    line-height: 256px;
    vertical-align: middle;
    text-align: center;
    }

    .image-swap-1 em {
    display: block;
    width: 256px;
    height: 256px;
    position: absolute;
    top: 0;
    left: 0;
    background: url('mouseover-images/thumbs.png');
    background-position: left;
    }

    .image-swap-1 a:hover em {
    background: url('mouseover-images/thumbs.png');
    background-position: right;
    }


    This code did not make hover buttons available to all users so I might have well as use simple graphics for button links.
     
  6. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    Try <audio> instead of <embed>

    <audio src="addams2.mid"></audio>
     
  7. sepala

    sepala

    Joined:
    May 20, 2010
    Messages:
    4,038
    (y):)
     
  8. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    Hmmm. Thanks for sticking with me on this. But the problem becomes more and more puzzling.

    Firstly, I cannot get the audio tag to work.

    Keeping with the embed tags on all pages

    Computer #1 Vista with Firefox 8.0 : Music works on all pages
    Computer #2 Win XP Home Firefox 7.0.1 Music works on all pages
    Computer #3 Win XP Prof. Firefox 7.0.1 No music on any page
    computer #4 Win XP Prof. Firefox 8.0 (wireless) No music on any page

    All four computers access the internet through the same router to the same cable modem using the same internet provider.
    I can play midi music file directly (off line) on all four computers
    Internet sites with video and sound clips (YouTube, etc.) play sound OK on all four.

    Evil gnomes at work???:rolleyes:

    My Halloween url is
    http://www.wolfworx.com/hwn2005/
     
  9. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    Take the embed out of the head, and put it in the body. Does it work now?
     
  10. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    Nope. Same difference, alas!
     
  11. Laxer

    Laxer

    Joined:
    Aug 28, 2011
    Messages:
    22
    I usually use javascript to handle my audio....

    I find it easier to work with....
    Code:
    <script language="javascript" type="text/javascript">
    function playSound(soundfile) {
    document.getElementById("music").innerHTML= "<OBJECT ID=\"MediaPlayer1\" CLASSID=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" CODEBASE=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701\" STANDBY=\"Loading Microsoft Windows® Media Player components...\" TYPE=\"application/x-oleobject\" width=\"1\" height=\"1\"><param name=\"fileName\" value=\""+soundfile+"\"><param name=\"animationatStart\" value=\"true\"><param name=\"transparentatStart\" value=\"true\"><param name=\"autoStart\" value=\"true\"><param name=\"showControls\" value=\"true\"><param name=\"Volume\" value=\"-300\"><embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" src=\""+soundfile+"\" name=\"MediaPlayer1\" width=1 height=1 autostart=1 showcontrols=1 volume=-300></OBJECT>";
    }
    </script>
    Then just add an empty element inside your body tag like:
    HTML:
    <span id="music"></span>
    And now just link to the sound clips like so:
    HTML:
    <a href="javascript:playSound(‘SOUNDCLIP.mid’);">
    If that's hard to follow an OP summed it up excellently here: How to make WMP invisible while playing audio
     
  12. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    I am beginning to think the problem is not with the html code at the server, but some tweek of the OS or Firefox.
    Note that Midi Music plays on
    Computer #1 Vista with Firefox 8.0
    Computer #2 Win XP Home Firefox 7.0.1
    but does not work on
    Computer #3 Win XP Prof. Firefox 7.0.1
    Computer #4 Win XP Prof. Firefox 8.0

    All four connect to the internet through the same router.

    Have not Yet checked with IE.
     
  13. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    Note that computers 3 and 4 have SP3 and #2 has SP2
    Computer #1 Vista with Firefox 8.0 : Music works on all pages
    Computer #2 Win XP Home (SP2) Firefox 7.0.1 Music works on all pages
    Computer #3 Win XP Prof. (SP3) Firefox 7.0.1 No music on any page
    computer #4 Win XP Prof. (SP3) Firefox 8.0 (wireless) No music on any page

    I tried IE 6 on #3. Music played, but not consistently on all pages tried.

    I tried a 5th computer Win XP Home (SP2) Firefox 7.0.1 Music works on all pages

    :confused:Could upgrading XP to SP 3 be the problem?
     
  14. Laxer

    Laxer

    Joined:
    Aug 28, 2011
    Messages:
    22
    It could all depend on what you are using to play the audio file....

    Browsers use different resources to play the audio. For example: Chrome has a built in Flash/Java that could be playing it....

    IMO the overall issue is the use of just the embed tag... It is not very well supported anymore and frequently causes problems....

    If its just one file try using Object/Param/Embed instead... Although it may look messier it is supported much better across all platforms.
     
  15. wolfworx

    wolfworx Thread Starter

    Joined:
    Oct 2, 2001
    Messages:
    1,227
    Of course I also tried the AUDIO tag. That does not work on #3 and #4 either.

    Ditto using Chrome browser. No music on #3 and #4.

    "If its just one file try using Object/Param/Embed instead... Although it may look messier it is supported much better across all platforms."

    "One file" ? meaning one page or instance of midi music? No, have about a dozen pages with midi reference tags.

    Still, the puzzle is why computers #1 and #2 play the midi music and others do not. Could it involve Java or something changed with SP3?

    I wish that a change of tags in the HTML code would provide more universal performance, but so far, that is not the case.
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1024310

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice