How can I play an online sound clip on Windows Phone 7? - windows-phone-7

I'm trying to create an application to play short sound clips that are found online. I can't put them on the client so they need to be played from the internet. I am able to play sounds using a MediaElement but only when the sound clip is found on the phone. How can I make it download an play a sound clip from the web?

MediaElement can be used for this. You should use the Source property.
<MediaElement x:Name="Media" Source="http://www.domain.com/song"/>
You can set the source from code as well
Media.Source = new Uri("http://www.domain.com/song");
Media.Play();

Related

How to record or get the audio while the audio is playing in windows phone 8?

noob here.
I am developing an app for windows phone that streams audio from the web. I've put the play function with MediaElement class, and i have no problem with it.
Then, i want to add a feature to get/record the audio that i stream. I've googling and didn't find what i want.
Is there a way to do that?
Regards,
BM
This is the Microphone class link which can be used to capture audi.
Give a try and let me know
Microphone to capture audio
also go nthrough this link
capturing and playing audio

Stream YouTube videos in a Windows Phone app

How do I stream YouTube videos in a Windows Phone app? I've tried using the MediaElement control and setting its Source property with the URL to a video and called the Play() method on the media element, but it didn't work. I want to create a simple video player that plays a video as it is being streamed. What kind of .NET classes do I need to work with?
YouTube does not expose its videos in a format which you can use to play them within Windows Phone applications, or any other kind of application for that matter. This is why services such as KeepVid, which provide 'hacks' for downloading YouTube videos, exist.
Please see my answer to this identical question from a few months ago over # Possible to play Youtube video in a wp7 app?

How can my app playback videos like metro tube does for Windows Phone 7?

I have to code an Windows Phone 7 application which playback videos from YouTube. That's kind of normal, but the first approach it's to playback them in the same way as MetroTube does it (see http://www.metrotubeapp.com/ ) (for example you can playback the youtube video without going to fullscreen and also have playback controls)
I do not have any idea of how to achieve this so, perhaps an embedded page based on You tube video integration but not quite sure yet.
Any idea of how to create this very flexible YouTube player for WP7?

how to play audio media directly in my windows phone application

I am making a ringtone setter application for windows phone 7. Can i ask a function so that the user can play the chosen ringtone in my application itself without exiting it. Or do i have to launch the media player.
You will have to use BackgroundAudioPlayer to achieve this. There is some explanation HERE
I hope it helps!

How to know if a music is currently playing on Windows Phone 7?

I am currently building an application for Windows Phone 7 which has to play music with the MediaPlayer.
However, I would like to know whether the phone is already playing some music, to ask the user if he want to play also my app's.
How could I get this information?
Thanks.
MediaPlayer.Queue.ActiveSong should do the trick.
MediaPlayer doco here for your reference.

Resources