Playing audio files

I am developing a web page that will present the user with a series of radiobuttons and a play button. The radio buttons will enable them to choose one of a series of sound clips and when they click the play button the sound will be played (by specifying a URL to stream it from).

The question is, does anybody know how to I can dynamically play the sounds. I need to be able to stream an audio file but can't hard code the url because it all depends on the choice made by the user. I have the URL's stored in a private DataTable but I'm not sure how to play them. I have tried to insert a media player object but I am not sure how to dynamically change the attributes.
If anyone can help I will be very gratefull. Thanks in advance :-)
8/29/2002 2:10:44 PM 93655 articles. 5 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 25

You can dynamically update a link using JavaScript. When the person clicks the link, have an onClick event that captures the click, along with the indicator of which clip is to be played, and then send the user to the URL using a navigate event.
Gregory A. Beamer
Author: ADO.NET and XML: ASP.NET on the Edge

Strange women lying in ponds distributing swords is no basis for a system of government.
8/29/2002 3:56:36 PM
The only problem is that I need them to stay on the current page. Surely navigating away will cause the current page to change? 

The page needs to have some way of embedded a sound in it, but that sounds needs to change depending on the selection made. I have tried to use an embedded media player, but I don't know how to change the BaseURL property of it.
Sorry if I have misunderstood, but any more help will be appreciated
8/30/2002 8:31:29 AM
Sorry, I forgot to add in the previous post that I have tried to use the following solution of embedding a media player object in the page and getting some inline c# code to write the url of the audio into the BaseURL parameter of the object. However, the problem occurs when the page is posted back after the play button is clicked. Although the Session["audio"] value is correct, the <object> tag is not re-rendered on the post back. Is there anyway of forcing it to render the entire page again?

Here's my attempt that doesn't appear to work:
<OBJECT style="Z-INDEX: 101; LEFT: 336px; POSITION: absolute; TOP: 232px" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" VIEWASTEXT>
<PARAM NAME="AudioStream" VALUE="-1">
<PARAM NAME="AutoSize" VALUE="-1">
<PARAM NAME="AutoStart" VALUE="-1">
<PARAM NAME="BaseURL" VALUE=" <% Response.Write(Session["audio"]); %> ">
<PARAM NAME="ClickToPlay" VALUE="-1">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="Filename" VALUE="">
8/30/2002 9:05:44 AM
I think you have to call the page from itslef and put a # a the end. Also, make sure you're using no-cache headers in the page <head> so the page won't save to cache.
7/11/2004 5:36:17 AM

Similar Artilces:

How to insert audio files and play audio files in a web form
Hi, 1) Could you please post a sample code which shows how to save an audio file and play an audio file from server? 2) Which of the following way is better for performance?         a) Save the audio file to a folder in the server and save the name of the file in database.         b) Save the audio file directly to database in binary format. Requirement is that Many people will be accessing the site and the same file at the same time. If anybody has any code for saving and playing audio file,...

How to play audio file in mobile form?
 Hi friends..I want play audio file on my mobile form on button control..can u tell me how it can achieve?plz anyone help me its very urgent or any related url plz send me.. Thanks and regardspash Use the PlaySound API, the PlaySound exists in coredll.dll.     Enum SoundFlags As Integer        SND_SYNC = &H0  ' play synchronously (default)         SND_ASYNC = &H1  ' play asynchronously         SND_NODEFAULT = &H2  ' silen...

How to play the wave file in the the web form?
How to play the wave file in the the web form? Check below link Haissam Abdul MalakMCAD.NET| Blog |...

WEB FORMS and datasetS (do I have to repeat the file definition in every web form?)
I am working on have a project with 35 web forms and an access file with 18 tables.Until now I have defined the oledbadapters in every form by dragging the tables from the server explorer tool box.This is not a good idea because every time that I make a change on the database design I have to drag the new definition on 35 web forms and I have to create the datasets again. This is boring and time consuming!The question is:WHAT CAN I DO TO HAVE THE FILE DEFINITION ONLY IN ONE PLACE AND THAT EVERY WEB FORM WOULD TAKE THE DATA ADAPTERS AND DATASETS FROM THERE? how about if you write a...

Implementing .Net Form into an web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

How to play Audio( wav , mp3 ) files in .net
Hi, Can anyone please tell me how can I play Audio files like wav and mps in .net. thanks in AdvanceHighOnCodingWanna get high! ...

Reading Excel Files from a .Net Web Form
Hi, This might be a dumb question, but ... When reading an Excel file from a .Net Web Form, is it necessary to have Microsoft Excel actually installed on the client machine running the web form? Also, do the Excel files being read need to be saved as "values only" or can the values be extracted from a spreadsheet where the cells contain formulas? Thanks. -Wayne Hi, For the 1st part, Office is not necessary to be installed. But Download the Office XP PIAs and use them to develop Office XP solutions with Visual Studio .NET. For 2nd Part I think you need to use Values.Regar...

how to read a .txt file from .net (web form)
hi, how to read a .txt file line by line and place the contents in a .xls file. ex: if sample.txt file is... Name: abc Company: xyz info ltd. i want abc and xyz info ltd to be cut and saved in .xls file. i already have a .xls template with name and company fields. send solution.......

Playing 3gp video file in web form...
 hii am building a web application where user can see 3gp videos on web page... but i don't know what control i should use for 3gp video file playing... BTW: a web service provide byte[] of 3gp video by idi need to play it in the web page... can anyone help Please click Mark as Answer on this post if it helps you You can not play the 3gp videos directly on web but you need to convert them in flash videos (.flv) dynamically at run time and use a flash video player to play then. There are no built in classes for doing so, but you can use third party components which will con...

Playing video file inside of web form
Hello Everyone,     I have a 3 minute video tutorial on my site which currently is shown to users when they click a hyperlink to it.  Of course when it's done this way their default media player opens and plays it when it has finished downloading.  So they look at a blank media player screen while they are waiting on the download to finish.  I would like to play the video in a web form where the video starts before it has finished loading so they can start watching the video right away.  Can anyone point me in the right direction on how to accompli...

how to open .exe file in a web form in
hi, Are there any one who know to open .exe file from a web form application? make a link like: My Exe ...

How to upload and load sound file from DB and play it on the web form !
Hello All I have a small problem with upload and load sound file and play it on the web form ! If any body have an previous experience with such matter please help me. I want to upload a sound file (MP3 or WAV) to SQL server Database and then retrieve it through button Click in the WEB form .NET Thanks in advanced M A Wizard...

How to send a 3gp audio or video file from a web form to mobile phone
I would like to know how you can transmit audio and/or video 3gp files to a mobile phone.Here's an example scenario I'm talking about: 1. The user goes into a web form and selects or clicks on a particular audio or video hyperlink.2. The web application would then ask for the cellphone number to send the audio or video file to.3. After entering the cellphone number and submitting, the user receives the 3gp file in the aforementioned cellphone.I would appreciate it very much if you could suggest some links, resources or anything that would accomplish this.  Is there a sample...

How to locate a file on PB11.5.1 .NET Web Form Target
Hi, PowerBuilder 11.5.1 Build 4675 Local Web Hosting : Window XP Pro IIS , Home directory = "c:\inetpub \wwwroot" I use a very simple function "FileExists" to locate a file, but it always retun FALSE from below scripts. if FileExists(file_name) = False then MessageBox("Error", "Could not find this file~n" + file_name) Return -1 end if The file_name is specified like this "D:\PB11.5\TEST\test.srd." I can confirm that the file do exist on my machine on specified path. And, it return TRUE when I run on normal PB application t...

How to locate a file on PB11.5.1 .NET Web Form Target
PowerBuilder 11.5.1 Build 4675 Local Web Hosting : Window XP Pro IIS , Home directory = "c:\inetpub \wwwroot" I use a very simple function "FileExists" to locate a file, but it always retun FALSE from below scripts. if FileExists(file_name) = False then MessageBox("Error", "Could not find this file~n" + file_name) Return -1 end if The file_name is specified like this "D:\PB11.5\TEST\test.srd." I can confirm that the file do exist on my machine on specified path. And, it return TRUE when I run on normal PB application target. A...

Web resources about - Playing audio files -

List of Japanese role-playing games by genre - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Donald Trump rips Barack Obama for playing 'more golf last year than Tiger Woods'
Republican presidential candidate Donald Trump took a swing at President Barack Obama, insinuating that his penchant for golf has gotten in the ...

Sydney Kings assistant coach Ben Knight to return to playing ranks and notch up game 400
Sydney Kings assistant coach Ben Knight is set to suit up for the struggling and injury-hit NBL club on Sunday and could achieve a fairytale ...

Playing Panic or Patience on MLB's Most Inactive Contenders - Bleacher Report
The good news for MLB 's most inactive contenders like the Los Angeles Dodgers and the Kansas City Royals is that it's not even Christmas yet, ...

Mutoid Man & Royal Thunder playing New Year's shows at Saint Vitus; Stephen Brodsky lists his top 10 ...
photo: Mutoid Man at FFF Fest 2015 (more by Tim Griffin) Two bands who mix metal and heavy blues, Mutoid Man and Royal Thunder, will ring in ...

Trump warns Clinton about playing "war on women" card
​Republican front-runner takes aim at Democratic counterpart after she referred to him as "sexist"

Chris Pine ‘couldn’t be happier’ playing the damsel in distress in ‘Wonder Woman’
... months. Gal Gadot is the star, obviously, as Wonder Woman. And Pine plays Captain Steve Trevor, WW’s love interest and he’s absolutely playing ...

Perry: Iosefa could see some playing time on Sunday
... form Search 40° Main menu Home Celtics Patriots Red Sox Bruins Revolution More WRITERS Watch Shop NECN Perry: Iosefa could see some playing ...

Dying Light's Legendary Levels aim to keep you playing forever
Techland is doing their damnedest to make sure they're on your radar for most improved developer. Most people weren't happy with Dead Island ...

Genius for Android shows lyrics for whatever you're playing
Genius is all about digging up lyrics for that song you're listening to, so it would only make sense if it brought up those lyrics at the very ...

Resources last updated: 12/25/2015 6:17:14 AM