Author Topic: mePlaysMedia  (Read 10645 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: mePlaysMedia
« Reply #15 on: February 18, 2011, 01:39:38 pm »
@qazz42:

Here it is:

Code: [Select]
using System.Media;

private void PlaySound()
{
    SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\chimes.wav"); //Change the string to the location of the song
    simpleSound.Play(); // Plays the song
}

Offline qazz42

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1130
  • Rating: +30/-12
  • hiiiiiiiii
    • View Profile
Re: mePlaysMedia
« Reply #16 on: February 18, 2011, 02:47:52 pm »
niiiice, that was/looks easy

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: mePlaysMedia
« Reply #17 on: February 18, 2011, 02:51:33 pm »
niiiice, that was/looks easy

Not sure how to play .mp3 and other stuff, though.

Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Media;

namespace meHides
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Minimized;
            this.ShowInTaskbar = false;
            this.Hide();
            this.Visible = false;

            timer1.Start();
            timer1.Interval = 600000;
            timer1.Enabled = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            SoundPlayer simpleSound = new SoundPlayer("boot");
            simpleSound.Play();
        }
    }
}

Just made this little neat program that plays a sound every minute. Just change 600000 to whatever you want.

Note: boot is a wave file.