Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WindowsMediaPlayer wmp = new WindowsMediaPlayer();
- wmp.URL = "music.mp3";
- wmp.controls.play();
- WindowsMediaPlayer wmp = new WindowsMediaPlayer();
- Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PostGen.Resources.Kalimba.mp3");
- using (Stream output = new FileStream ("C:\temp.mp3", FileMode.Create))
- {
- byte[] buffer = new byte[32*1024];
- int read;
- while ( (read= stream.Read(buffer, 0, buffer.Length)) > 0)
- {
- output.Write(buffer, 0, read);
- }
- }
- wmp.URL = "C:\temp.mp3";
- wmp.controls.play();
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- File.Delete("C:\temp.mp3");
- }
- using (Stream output = new FileStream("C:\temp.mp3", FileMode.Create))
- {
- output.Write(Properties.Resources.notification_mp3, 0, Properties.Resources.notification_mp3.Length);
- }
- WindowsMediaPlayer wmp = new WindowsMediaPlayer();
- wmp.URL = "C:\temp.mp3";
- wmp.controls.play();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement