The text of this article is not in this database — only its details are. Read it on the old site: Play Sounds on an ASP.NET Web Page
3 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Play Sounds on an ASP.NET Web Page
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Ed DolikianPosted Feb 3, 2009, 3:44 PM
Scott, Excellent article. It has really helped me a lot. I'm trying to get something to work and after almost a week, thought I'd simply ask. Suppose src file is in a directory off the root. How would you set the path. Although I set it to a file that exists, it simply won't play no matter what I try. (e.g. Ive tried filename = "App_Data/playfile.wav", Server.MapPath("app_data/playfile.wav") If I move the file back to the application root it works / plays when the page is loaded. Because of item 2, I don't want my users to have R/W privledges to my application root. Secondly, my real objective is to create the file that I want to play by making a selection from a GridView record. In this case, Soundfile is saved as a byte stream in a record of my database. When I select the record, I have it writing a file to the App_data subdirectory. (overwrites playfile.wav) I then attempt to set the PlayPageSound to that same file again. Either Gridview doesn't trigger a postback or file does not exist yet or get recongnized as existing. Anyidea's of how to make this work? Afterward, file was written cause I can play it back.