Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 739189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:22:17+00:00 2026-05-14T08:22:17+00:00

I converted a local sound file to a resource, which built this in my

  • 0

I converted a local sound file to a resource, which built this in my XAML:

<UserControl.Resources>
    <my:Uri x:Key="SoundFiles">file:///c:/Audio/HebrewDemo/Shalom.wav</my:Uri>
</UserControl.Resources>

I did this by pasting a local disk mp3 filename into source, then clicked on the “dot” by source and chose “Extract Value to Resource”.

When I run, it tells me that “Uri” is not valid, and sure enough, in the Intellisense, I see other elements that start with “uri” but not just URI by itself.

In the real world I want to specify a dynamic mp3 file name. For example, I might have a database of foreign language words used for flashcards, I want to play a sound file on a URL. But I thought I would try to walk before running…

Now I’m trying this:

    mediaElement1.Source = new Uri(
                     "http://HebrewResources.com/SoundFiles/Shalom.mp3", 
                      UriKind.Absolute); 
    mediaElement1.Play(); 

The status bar in the FireFox browser indicates some data being transferred from the website. However, I never hear any sound. Could it just be an encoding issue? If it is not encoded properly, would I get an error?

Also, can I put the Uri statement in the load or make it run in the background, so the user can read the screen, at the same time the sound file is downloading? In other words, when he clicks the button to hear the soundfile, ideally it would already be preloaded for him. In this language-learning app, the user will see a word in a foreign language, and try to pronounce it himself, then he will click the “Play” button to hear the sound to check his results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:22:17+00:00Added an answer on May 14, 2026 at 8:22 am

    The first code which points to the local file won’t work in a normal Silverlight application because of Silverlights “sanboxed” security model. Running a normal Silverlight application in your browser, you can’t access local resources like you can if you were running an installed winforms/WPF application. Have a look at this video tutorial http://www.silverlight.net/learn/videos/all/local-file-access/, if you want to learn more about accessing local files using Silverlight.

    In regards to your second piece of code, it should work, so quite possibly it’s an encoding issue, and no unfortunately you often don’t get any errors for things like that.

    I created a sample app and pointed it at your mp3 file and it’ wouldn’t work, however a quick search for sample mp3s, lead me to another freely available (first hit). Using the code/url below, it works ok.

    myMediaelement.Source = new Uri("http://www.robtowns.com/music/blind_willie.mp3", UriKind.Absolute);
    

    In regards to the loading, it will start downloading the file when it hits the code that sets the source of the mediaelement. So if you set the source for the media element in your constructor or in your loaded event, it will automatically start downloading in the background. Then you just call myMediaelement.Play(); on the button click event.

    If you find using Firefox a bit limited, when it comes to determine what and when something like external files or webservices are being loaded. There’s a great free tool called Fiddler (http://www.fiddlertool.com/fiddler/version.asp) which will let you monitor those things very easily.

    Good luck 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to define a local resource in my xaml which is supposed to
I have a .NET assembly that was converted from a jar file. This library
I have converted date to my local time as below: $this->date_string = %Y/%m/%d %h:%i:%s;
I converted a war file into a zip file to do some customizations. Renaming
Image converted to RGB grayscale. Next, Grayscale-image is translated into an array, which are
This webservice is almost converted form VB to C#, except I get this error
I converted a local application to a Java applet for data security 1 but
File is from a Nikon D3s (mov) converted with ffmpeg to mp4. Working without
I had a powerbuilder application which i converted to web application in the format
Hi All I want to extract time for my local time zone which i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.