CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    77

    Question Play audio in web page

    Hi all

    I m working on a website which will allow users to upload audio file in any format to make their collection. This website will play those audios for user whenever they want.

    i don't know how do I accomplish this task

    I have some confusions
    1. Should I store the uploaded file in their original formats in my host server OR convert them to one specific format(ex. mp3 or wav) and then play with that format only

    2. also i don't know how to play audio in web page

    Any suggestions, Ideas, Links would be most appreciable

    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    18° 32' N / 73° 52' E
    Posts
    416

    Re: Play audio in web page

    Why do you feel the need of converting the audio file format to mp3, etc? you may keep the original file format and avoid conversion overhead.

    Also, you can play the audio files by embedding the flash player or windows media player in a page.

    Regards,
    MMH

  3. #3
    Join Date
    Jan 2008
    Posts
    47

    Re: Play audio in web page

    dear ujja..

    first of all you can play a media file from web page simply by requesting
    this as a resource , more specifically <a href=xyz.wav>aek do theen..</a>
    will start windows media player and playing the song,

    another way is <embedd> tag.

    ok conversion you convert it or not, purely your choice, any the stored format should be supoted by windows media player

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Play audio in web page

    A simple example of embeding a MIDI file would be :
    HTML Code:
    <EMBED SRC="sounds/canonind.mid" NAME="slideshowMusic" HIDDEN="true"
           LOOP="true" AUTOSTART="false" VOLUME="100%" MASTERSOUND>
    This means, that no visual representation of the sound being played will be shown, it will loop, meaning repeat, and it will play at 100% volume.

    A simple example of embedding a Shockwave flash object would be :
    HTML Code:
    <embed 
      src="quiz.swf" 
      width="500"
      height="500"
      allowscriptaccess="always"
      allowfullscreen="true"
      flashvars="file=playlist.xml&autostart=true"
    />
    Which will embed the fill named quiz.swf onto the page

    A simple way to embed the Windows Media Player onto your web page would be :
    HTML Code:
    <OBJECT id="VIDEO" width="320" height="240" 
    	style="position:absolute; left:0;top:0;"
    	CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
    	type="application/x-oleobject">
    	
    	<PARAM NAME="URL" VALUE="ringin.wav">
    	<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
    	<PARAM NAME="AutoStart" VALUE="True">
    	<PARAM name="uiMode" value="mini"> <!-- Use none for no toolbar -->
    	<PARAM name="PlayCount" value="9999">
    </OBJECT>
    So, you have a lot of options..

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured