Problem to call an mp3 file from a swf file

Discussion in 'HTML' started by Steph, Jan 17, 2008.

  1. Steph

    Steph Guest

    Hello,

    I have a flash file (accueil.swf) that calls an mp3 file (the_song.mp3) to
    load a song when the swf animation is launched.
    Both files are stored on the same root directory (in my PC and onto the web
    server).

    When i click directly on the swf file right on the directory from my PC, the
    animation works and the song is correctly loaded (we hear the song).

    When i launch from my web server the script below that is supposed to do the
    same thing, the animation works but the song is not loaded (so no song is
    launched).

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="170" height="240">
    <param name="movie" value="accueil.swf">
    <param name="quality" value="high">
    <embed src="accueil.swf" quality="high"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="170" height="240"></embed>
    </object>


    Can someone explain me why ?

    Many thanks in advance
    Steph
     
    Steph, Jan 17, 2008
    #1
    1. Advertising

  2. Steph

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Thu, 17 Jan 2008 19:24:24
    GMT Steph scribed:

    > Hello,
    >
    > I have a flash file (accueil.swf) that calls an mp3 file
    > (the_song.mp3) to load a song when the swf animation is launched.
    > Both files are stored on the same root directory (in my PC and onto
    > the web server).
    >
    > When i click directly on the swf file right on the directory from my
    > PC, the animation works and the song is correctly loaded (we hear the
    > song).
    >
    > When i launch from my web server the script below that is supposed to
    > do the same thing, the animation works but the song is not loaded (so
    > no song is launched).
    >
    > <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfla
    > sh.cab#version=7,0,19,0" width="170" height="240">
    > <param name="movie" value="accueil.swf">
    > <param name="quality" value="high">
    > <embed src="accueil.swf" quality="high"
    > pluginspage="http://www.macromedia.com/go/getflashplayer"
    > type="application/x-shockwave-flash" width="170" height="240"></embed>
    > </object>
    >
    >
    > Can someone explain me why ?
    >
    > Many thanks in advance
    > Steph


    Maybe on the server the swf is looking at the actual _root_, not your
    site's hypothetical "root folder". Try replacing the_song.mp3 with an
    absolute url.

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 17, 2008
    #2
    1. Advertising

  3. Steph

    cwdjrxyz Guest

    On Jan 17, 1:24 pm, "Steph" <> wrote:
    > Hello,
    >
    > I have a flash file (accueil.swf) that calls an mp3 file (the_song.mp3) to
    > load a song when the swf animation is launched.
    > Both files are stored on the same root directory (in my PC and onto the web
    > server).
    >
    > When i click directly on the swf file right on the directory from my PC, the
    > animation works and the song is correctly loaded (we hear the song).
    >
    > When i launch from my web server the script below that is supposed to do the
    > same thing, the animation works but the song is not loaded (so no song is
    > launched).
    >
    > <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v..."
    > width="170" height="240">
    > <param name="movie" value="accueil.swf">
    > <param name="quality" value="high">
    > <embed src="accueil.swf" quality="high"
    > pluginspage="http://www.macromedia.com/go/getflashplayer"
    > type="application/x-shockwave-flash" width="170" height="240"></embed>
    > </object>
    >
    > Can someone explain me why ?


    I would not use the swf file to call the song if I wanted it to play
    every time the flash file is called. Rather I would make the song an
    audio part of a flv for a flv/swf. When you encode the flash, you can
    select both a video file to encode for flash and a mp3 file to be
    encoded as the audio part of the flv. If the video file already has
    audio, you can select to replace it with another audio file. Don't
    forget that the flv is the media part (audio/video) and and the swf is
    only the player container for the flash, and it is of small byte size
    compared to the flv.. You only link to the swf in the html code.
    However, either on your computer on your server. both the flv file and
    the container swf file should be in the same directory. When you
    encode it usually is assumed that both files will be used in the same
    directory. When you call for the swf container, it automatically looks
    for the flv file in the same directory and downloads it to the
    temporary cache of the browser. You can encode to start downloading
    the flv at once or only when you use a start button on the swf player
    container you encode.
     
    cwdjrxyz, Jan 17, 2008
    #3
  4. Steph

    Steph Guest

    "Neredbojias" <> a écrit dans le message de news:
    Xns9A28928E219E5nanopandaneredbojias@194.177.96.78...
    > Well bust mah britches and call me cheeky, on Thu, 17 Jan 2008 19:24:24
    > GMT Steph scribed:
    >
    >> Hello,
    >>
    >> I have a flash file (accueil.swf) that calls an mp3 file
    >> (the_song.mp3) to load a song when the swf animation is launched.
    >> Both files are stored on the same root directory (in my PC and onto
    >> the web server).
    >>
    >> When i click directly on the swf file right on the directory from my
    >> PC, the animation works and the song is correctly loaded (we hear the
    >> song).
    >>
    >> When i launch from my web server the script below that is supposed to
    >> do the same thing, the animation works but the song is not loaded (so
    >> no song is launched).
    >>
    >> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    >> codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfla
    >> sh.cab#version=7,0,19,0" width="170" height="240">
    >> <param name="movie" value="accueil.swf">
    >> <param name="quality" value="high">
    >> <embed src="accueil.swf" quality="high"
    >> pluginspage="http://www.macromedia.com/go/getflashplayer"
    >> type="application/x-shockwave-flash" width="170" height="240"></embed>
    >> </object>
    >>
    >>
    >> Can someone explain me why ?
    >>
    >> Many thanks in advance
    >> Steph

    >
    > Maybe on the server the swf is looking at the actual _root_, not your
    > site's hypothetical "root folder". Try replacing the_song.mp3 with an
    > absolute url.
    >
    > --
    > Neredbojias
    > Riches are their own reward.


    That could be an idea indeed. I'll check and let you know ...
     
    Steph, Jan 17, 2008
    #4
  5. Steph

    Steph Guest

    "cwdjrxyz" <> a écrit dans le message de news:
    ...
    > On Jan 17, 1:24 pm, "Steph" <> wrote:
    >> Hello,
    >>
    >> I have a flash file (accueil.swf) that calls an mp3 file (the_song.mp3)
    >> to
    >> load a song when the swf animation is launched.
    >> Both files are stored on the same root directory (in my PC and onto the
    >> web
    >> server).
    >>
    >> When i click directly on the swf file right on the directory from my PC,
    >> the
    >> animation works and the song is correctly loaded (we hear the song).
    >>
    >> When i launch from my web server the script below that is supposed to do
    >> the
    >> same thing, the animation works but the song is not loaded (so no song is
    >> launched).
    >>
    >> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    >> codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v..."
    >> width="170" height="240">
    >> <param name="movie" value="accueil.swf">
    >> <param name="quality" value="high">
    >> <embed src="accueil.swf" quality="high"
    >> pluginspage="http://www.macromedia.com/go/getflashplayer"
    >> type="application/x-shockwave-flash" width="170" height="240"></embed>
    >> </object>
    >>
    >> Can someone explain me why ?

    >
    > I would not use the swf file to call the song if I wanted it to play
    > every time the flash file is called. Rather I would make the song an
    > audio part of a flv for a flv/swf. When you encode the flash, you can
    > select both a video file to encode for flash and a mp3 file to be
    > encoded as the audio part of the flv. If the video file already has
    > audio, you can select to replace it with another audio file. Don't
    > forget that the flv is the media part (audio/video) and and the swf is
    > only the player container for the flash, and it is of small byte size
    > compared to the flv.. You only link to the swf in the html code.
    > However, either on your computer on your server. both the flv file and
    > the container swf file should be in the same directory. When you
    > encode it usually is assumed that both files will be used in the same
    > directory. When you call for the swf container, it automatically looks
    > for the flv file in the same directory and downloads it to the
    > temporary cache of the browser. You can encode to start downloading
    > the flv at once or only when you use a start button on the swf player
    > container you encode.


    I'm not an expert on flv file. So i'm not sure to have well understood your
    advice.
    Is it possible to provide me with an example so that i can more precisely
    understand ?
     
    Steph, Jan 17, 2008
    #5
  6. On Jan 17, 2:24 pm, "Steph" <> wrote:
    > When i click directly on the swf file right on the directory from my PC, the
    > animation works and the song is correctly loaded (we hear the song).
    >
    > When i launch from my web server the script below that is supposed to do the
    > same thing, the animation works but the song is not loaded (so no song is
    > launched).


    Depending on the version you are publishing with you can trap the load
    error and see exactly why it is not loading. I believe actionscript
    has supported "try" since version 7

    Also check the location flash "believes" it is in. If run from an LMS
    this is not always where you think it is.
     
    Travis Newbury, Jan 17, 2008
    #6
  7. Steph

    cwdjrxyz Guest

    On Jan 17, 4:07 pm, "Steph" <> wrote:
    > "cwdjrxyz" <> a écrit dans le message de news:
    > ...
    >
    >
    >
    > > On Jan 17, 1:24 pm, "Steph" <> wrote:
    > >> Hello,

    >
    > >> I have a flash file (accueil.swf) that calls an mp3 file (the_song.mp3)
    > >> to
    > >> load a song when the swf animation is launched.
    > >> Both files are stored on the same root directory (in my PC and onto the
    > >> web
    > >> server).

    >
    > >> When i click directly on the swf file right on the directory from my PC,
    > >> the
    > >> animation works and the song is correctly loaded (we hear the song).

    >
    > >> When i launch from my web server the script below that is supposed to do
    > >> the
    > >> same thing, the animation works but the song is not loaded (so no song is
    > >> launched).

    >
    > >> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    > >> codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#v..."
    > >> width="170" height="240">
    > >> <param name="movie" value="accueil.swf">
    > >> <param name="quality" value="high">
    > >> <embed src="accueil.swf" quality="high"
    > >> pluginspage="http://www.macromedia.com/go/getflashplayer"
    > >> type="application/x-shockwave-flash" width="170" height="240"></embed>
    > >> </object>

    >
    > >> Can someone explain me why ?

    >
    > > I would not use the swf file to call the song if I wanted it to play
    > > every time the flash file is called. Rather I would make the song an
    > > audio part of a flv for a flv/swf. When you encode the flash, you can
    > > select both a video file to encode for flash and a mp3 file to be
    > > encoded as the audio part of the flv. If the video file already has
    > > audio, you can select to replace it with another audio file. Don't
    > > forget that the flv is the media part (audio/video) and and the swf is
    > > only the player container for the flash, and it is of small byte size
    > > compared to the flv.. You only link to the swf in the html code.
    > > However, either on your computer on your server. both the flv file and
    > > the container swf file should be in the same directory. When you
    > > encode it usually is assumed that both files will be used in the same
    > > directory. When you call for the swf container, it automatically looks
    > > for the flv file in the same directory and downloads it to the
    > > temporary cache of the browser. You can encode to start downloading
    > > the flv at once or only when you use a start button on the swf player
    > > container you encode.

    >
    > I'm not an expert on flv file. So i'm not sure to have well understood your
    > advice.
    > Is it possible to provide me with an example so that i can more precisely
    > understand ?


    Here is an example of a flv/swf at http://www.cwdjr.net/flash/Fatty.php
    . The flv file is about 22 MB for this rather long video. The swf
    container file is only about 12 KB. As I mentioned, the flv must be in
    the same directory on the server or computer as the swf container
    file. If you view the source code, you will not see the flv
    referenced, because this is done within the swf file. The flv file is
    at http://www.cwdjr.net/flash/Fatty.flv. It can be played alone
    without the swf container file only if you have a flv player. The
    video was captured and edited in high resolution mpeg2 format as is
    often done before burning a DVD. The video has very old sound. When I
    encoded to flash, the mpeg2 video was used as input. Several other
    video formats may be used instead for input to the flash encoder. At
    one stage of encoding, I am offered the option to remove or add audio
    to the flash. In this case, I chose to keep the audio that came with
    the video input. In other cases I chose to replace or add audio in the
    mp3 format. There are many options given for building the swf
    container portion of flash. Finally when you are finished encoding,
    you get the output of a swf container file and a flv video file. The
    exact steps in encoding the the flv/swf depend on the encoder used and
    can differ considerably for different encoders.
     
    cwdjrxyz, Jan 18, 2008
    #7
  8. Neredbojias wrote:

    > Maybe on the server the swf is looking at the actual _root_, not your
    > site's hypothetical "root folder". Try replacing the_song.mp3 with an
    > absolute url.


    The SWF runs on the client, not the server. The client has no idea about
    what the server's filesystem is like.

    --
    Toby A Inkster BSc (Hons) ARCS
    [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
    [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 18 days, 20:27.]

    Ham vs Bacon vs Pork
    http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/
     
    Toby A Inkster, Jan 18, 2008
    #8
  9. Steph wrote:

    > Can someone explain me why ?


    1. Visit the page and observe that there is no sound.

    2. Look up the error log for your web server.

    3. In the error log you should find some failed requests for the MP3. If
    you do not, then it means the MP3 is probably not being requested from
    your server at all.

    4. Look at the requested path for the MP3. Does it exactly match the
    actual path for the MP3?

    --
    Toby A Inkster BSc (Hons) ARCS
    [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
    [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 18 days, 20:30.]

    Ham vs Bacon vs Pork
    http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/
     
    Toby A Inkster, Jan 18, 2008
    #9
  10. Steph

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Fri, 18 Jan 2008 09:15:08 GMT
    Toby A Inkster scribed:

    > Neredbojias wrote:
    >
    >> Maybe on the server the swf is looking at the actual _root_, not your
    >> site's hypothetical "root folder". Try replacing the_song.mp3 with an
    >> absolute url.

    >
    > The SWF runs on the client, not the server. The client has no idea about
    > what the server's filesystem is like.


    Well of course, but files must still be addressed correctly to be
    downloaded/streamed.

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 18, 2008
    #10
  11. Steph

    Steph Guest

    "Steph" <> a écrit dans le message de news:
    478fd0f0$0$15471$...
    >
    > "Neredbojias" <> a écrit dans le message de news:
    > Xns9A28928E219E5nanopandaneredbojias@194.177.96.78...
    >> Well bust mah britches and call me cheeky, on Thu, 17 Jan 2008 19:24:24
    >> GMT Steph scribed:
    >>
    >>> Hello,
    >>>
    >>> I have a flash file (accueil.swf) that calls an mp3 file
    >>> (the_song.mp3) to load a song when the swf animation is launched.
    >>> Both files are stored on the same root directory (in my PC and onto
    >>> the web server).
    >>>
    >>> When i click directly on the swf file right on the directory from my
    >>> PC, the animation works and the song is correctly loaded (we hear the
    >>> song).
    >>>
    >>> When i launch from my web server the script below that is supposed to
    >>> do the same thing, the animation works but the song is not loaded (so
    >>> no song is launched).
    >>>
    >>> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    >>> codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfla
    >>> sh.cab#version=7,0,19,0" width="170" height="240">
    >>> <param name="movie" value="accueil.swf">
    >>> <param name="quality" value="high">
    >>> <embed src="accueil.swf" quality="high"
    >>> pluginspage="http://www.macromedia.com/go/getflashplayer"
    >>> type="application/x-shockwave-flash" width="170" height="240"></embed>
    >>> </object>
    >>>
    >>>
    >>> Can someone explain me why ?
    >>>
    >>> Many thanks in advance
    >>> Steph

    >>
    >> Maybe on the server the swf is looking at the actual _root_, not your
    >> site's hypothetical "root folder". Try replacing the_song.mp3 with an
    >> absolute url.
    >>
    >> --
    >> Neredbojias
    >> Riches are their own reward.

    >
    > That could be an idea indeed. I'll check and let you know ...


    That was the case, it works with the absolute URL.
    Many thanks !
     
    Steph, Jan 19, 2008
    #11
  12. Steph

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Sat, 19 Jan 2008 23:01:13
    GMT Steph scribed:

    >>>> Hello,
    >>>>
    >>>> I have a flash file (accueil.swf) that calls an mp3 file
    >>>> (the_song.mp3) to load a song when the swf animation is launched.
    >>>> Both files are stored on the same root directory (in my PC and onto
    >>>> the web server).
    >>>>
    >>>> When i click directly on the swf file right on the directory from
    >>>> my PC, the animation works and the song is correctly loaded (we
    >>>> hear the song).
    >>>>
    >>>> When i launch from my web server the script below that is supposed
    >>>> to do the same thing, the animation works but the song is not
    >>>> loaded (so no song is launched).
    >>>>
    >>>> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    >>>> codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/sw
    >>>> fla sh.cab#version=7,0,19,0" width="170" height="240">
    >>>> <param name="movie" value="accueil.swf">
    >>>> <param name="quality" value="high">
    >>>> <embed src="accueil.swf" quality="high"
    >>>> pluginspage="http://www.macromedia.com/go/getflashplayer"
    >>>> type="application/x-shockwave-flash" width="170"
    >>>> height="240"></embed>
    >>>> </object>
    >>>>
    >>>>
    >>>> Can someone explain me why ?
    >>>>
    >>>> Many thanks in advance
    >>>> Steph
    >>>
    >>> Maybe on the server the swf is looking at the actual _root_, not
    >>> your site's hypothetical "root folder". Try replacing the_song.mp3
    >>> with an absolute url.
    >>>
    >>> --
    >>> Neredbojias
    >>> Riches are their own reward.

    >>
    >> That could be an idea indeed. I'll check and let you know ...

    >
    > That was the case, it works with the absolute URL.
    > Many thanks !


    You're welcome, and good luck with the site.

    --
    Neredbojias
    Riches are their own reward.
     
    Neredbojias, Jan 20, 2008
    #12
  13. On Jan 19, 6:01 pm, "Steph" <> wrote:
    > That was the case, it works with the absolute URL.
    > Many thanks !


    This wasn't a solution. It is a short term fix. You need to find
    out what the real issue is and start using relative URLs
     
    Travis Newbury, Jan 20, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Dyer
    Replies:
    6
    Views:
    20,067
    Knute Johnson
    Jan 22, 2006
  2. Asle Frantzen

    Mp3-player - how to play an mp3?

    Asle Frantzen, Jul 8, 2003, in forum: C++
    Replies:
    5
    Views:
    681
    Kelsey Bjarnason
    Jul 22, 2003
  3. HY Tech
    Replies:
    0
    Views:
    628
    HY Tech
    Sep 7, 2003
  4. CD Baby
    Replies:
    2
    Views:
    174
    CD Baby
    Mar 21, 2005
  5. asgweb

    mp3 to .swf (flash)?

    asgweb, Nov 30, 2010, in forum: Perl Misc
    Replies:
    1
    Views:
    114
    Justin C
    Dec 1, 2010
Loading...

Share This Page