3 Replies - 984 Views - Last Post: 23 August 2009 - 09:06 AM Rate Topic: -----

#1 Crimson Wings  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 215
  • Joined: 11-July 09

Playing Audio Files And Saving Program Settings.

Post icon  Posted 20 August 2009 - 07:59 PM

Hi guys. I have been wanting to do myself a simple nice alarm clock for myself, as my computer is in my room and I leave it on in the nights most of the time.

I have been wondering, how can I play Audio files with it? C# is the only 'desktop' programming language with which I am a bit 'fluent', but I am nowhere near an expert with it and I don't use it too much either. So probably you could explain it like I was a noob ^^;.

Also, it will be the first 'official' application I make, and I don't know how to save user settings (like in this case, the time in which the alarm will play, the selected song, etc), so I was wondering how exactly do I save settings, or how do people normally do it? I was planning in reading an XML with the settings because I am not too familiar with C#'s method of dealing with databases...

Is This A Good Question/Topic? 0
  • +

Replies To: Playing Audio Files And Saving Program Settings.

#2 lesPaul456  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 173
  • View blog
  • Posts: 729
  • Joined: 16-April 09

Re: Playing Audio Files And Saving Program Settings.

Posted 21 August 2009 - 04:19 PM

View PostCrimson Wings, on 20 Aug, 2009 - 08:59 PM, said:

Hi guys. I have been wanting to do myself a simple nice alarm clock for myself, as my computer is in my room and I leave it on in the nights most of the time.

I have been wondering, how can I play Audio files with it? C# is the only 'desktop' programming language with which I am a bit 'fluent', but I am nowhere near an expert with it and I don't use it too much either. So probably you could explain it like I was a noob ^^;.

Also, it will be the first 'official' application I make, and I don't know how to save user settings (like in this case, the time in which the alarm will play, the selected song, etc), so I was wondering how exactly do I save settings, or how do people normally do it? I was planning in reading an XML with the settings because I am not too familiar with C#'s method of dealing with databases...


I'll answer your second question first. If you are using Visual Studio or Visual Studio Express, you can store by selecting "Settings" from your project's properties page and then creating new settings fields. This stores the settings in the projects default Settings.settings file. Here's a link to a MSDN tutorial.
If you prefer you can store settings using XML or even a database, however it will be more difficult...

Playing audio files in C# is relatively easy. You can use the SoundPlayer class from the "System.Media" namespace, or you can use Audio playack methods provided by DirectX SDK.

Hope this helps!

This post has been edited by lesPaul456: 21 August 2009 - 04:21 PM

Was This Post Helpful? 0
  • +
  • -

#3 Crimson Wings  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 215
  • Joined: 11-July 09

Re: Playing Audio Files And Saving Program Settings.

Posted 22 August 2009 - 03:03 PM

So storing them in a settings.settings file is the method most people use?
Was This Post Helpful? 0
  • +
  • -

#4 lesPaul456  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 173
  • View blog
  • Posts: 729
  • Joined: 16-April 09

Re: Playing Audio Files And Saving Program Settings.

Posted 23 August 2009 - 09:06 AM

View PostCrimson Wings, on 22 Aug, 2009 - 04:03 PM, said:

So storing them in a settings.settings file is the method most people use?


Not necessarily. Some people may prefer to use xml files, others may prefer CSV files...

Using a settings file, though, is easier, faster and requires less code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1