i m making a Windows Application which work over ITunes. Currently i m able to find the location of a song (which is on local machine ) and URL ( which is running from stream like radio, podcast at the time of buffering)
Is it easy to play a song which is on local Machine..
obj = new iTunesAppClass();
obj.PlayFile(#"d:/4.mp3")
but when i tries the url inside playfile() method it doesn't work is there another way to play
online songs/radio ?
We can see play method here
if you want to open an Url you should use the OpenUrl() Method.
obj.OpenURL("http://108.166.161.205:8795");
Related
I was publishing my first C# Windows Form Application with a built-in audio player (I used System.Media), but when I tried to run the program on another PC of mine, it returned an exception and then crashed every time I click on the button to play audio so I was wondering if there was a way to play the audio on another PC without crashing.
Here's the code part I used to play the sound:
System.Media.SoundPlayer player = new System.Media.SoundPlayer("mouse_click.wav");
player.Play();
Then the PC I used to run the program returned this error: verify that the audio file path is correct.
Thank you everyone for the help!
If you want to add a Wav file to Windows Form Application, you can refer to the following steps:
First, add the Wav file in the Resources File (Project>Properties>Resources):
Second, refer to the following code to play the Wav file in VS:
System.Media.SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources._15035);//Use your own filename in place of _15035
player.Play();
I know you can use url:
axWindowsMediaPlayer1.URL =
#"http://go.microsoft.com/fwlink/?LinkId=95772";
But if i want to play a local video file from my hard disk ?
URL doesn't necessarily needs an internet address. You can set it to a local address in your hard disk. Something like this:
axWindowsMediaPlayer1.URL = #"c:\myvideo.avi";
Windows Phone 8 gives the ability to change the default camera app with another one downloaded from the store, making this new app the one that's launched when you hit the camera hardware button.
So I was wondering if is there any chance to launch this app using the CameraCaptureTask.
What I'd like to do is something simple like
var camera = new CameraCaptureTask();
camera.Show();
camera.Completed += new EventHandler<PhotoResult>(camera_Completed);
but I want this to work with the default app that the user chose on its device, and not with the basic Microsoft's one.
I've not found anything online, so I'm asking to you guys if I can make what I want.
Sorry, not possible with the current API.
Im trying to play a video clip in my Silverlight Application.
var video_path = "http://mydomain.com/path-to-media/file.wmv";
mediaPlayer.AutoPlay = true;
mediaPlayer.Source = new Uri(video_path);
mediaPlayer.Play();
MessageBox.Show(mediaPlayer.Source.ToString()); //test the source string
But the video does not start or even display.
Is there a step I have forgotten ?
mediaPlayer is a simple Silverlight MediaElement
Update
When I attach a media Failed event and display the error exception i get
4001 AG_E_NETWORK_ERROR
It's because your silverlight application has a different URL scheme, and cross-scheme access is not allowed for media.
If the video URL starts from http://, your application URL should start from http:// too.
I think your application URL looks something like file:///C:/project/page.html. If so, you should add a ASP.Net website to your solution and host your Silverlight application there so that your URL looks like http://localhost:25252/page.html.
I'm using WIA (Windows Image Acquisition) to grab photos from a camera. Using WIA 2.0, .net 4 C#, my test device is a Nikon D90 (yup, I have it actually plugged in). So the scenario is:
User has camera plugged into PC
User takes a photo from the camera itself
My application downloads the image via WIA
All of the above is working.
The problem I'm having is getting the current time from the device itself. The first time I get the time from the device I get the correct time, all good. If I run my application again, WIA seems to cache the time I got earlier and returns that, which is useless.
// use the WIA.DeviceManager to get the deviceInfo (not shown)
var device = deviceInfo.Connect();
var prop = device.Properties["Device Time"];
Vector deviceTimeVector = (Vector)prop.get_Value();
var deviceTime = deviceTimeVector.Date;
Does anyone who's done some work with WIA know how to reliably get the current time from a device? I've tried a synchronise but this doesn't seem to have any effect.
_device.ExecuteCommand(WIA.CommandID.wiaCommandSynchronize);
Open to suggestions too. I was thinking my only other way would be to "calibrate" the device by taking a test shot, checking what the time taken of that picture was but there's problems with this too.
Please let me know if you need any information.