I'll demonstrate how to write a simple program which plays any audio which you want :)
- Create a new Project
- Select Target Framework as 7.1
- In you Main.xaml.cs , include the library "Microsoft.Phone.Scheduler".
- I've placed the audio file on the root , if you want you can create a folder as audio and place your file there. Then you should navigate as per your need.
- Now write the following code
- Alarm myAlarm = new Alarm("mmfAlarmTest");
- // You need to specify a name for the alarm
- myAlarm.BeginTime = DateTime.Now.AddMinutes(1);
- // I would like it to play after 1 minute of execution
- myAlarm .Sound = new Uri("/toss-the-feathers.mp3",UriKind.RelativeOrAbsolute);
- // Remember my audio file is on the root directory?
- ScheduledActionService.Remove("mmfAlarmTest");
- // Remove if there exist a similar alarm
- ScheduledActionService.Add(myAlarm);
- // Register your alarm
And that's it !!! . Test it out and enjoy the fun ;) Using this, you can generate an application which sets alarm through your application