Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,166 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,873 people online right now. Registration is fast and FREE... Join Now!




Sound on click event

 
Reply to this topicStart new topic

Sound on click event, Final project for school

AllisDeviant
3 Dec, 2007 - 07:04 PM
Post #1

New D.I.C Head
*

Joined: 3 Dec, 2007
Posts: 1


My Contributions
I don't have any code right now. Since I still have to learn about objects but I am suppose to make a educational program for my final project.

I decided to make a program that will teach you the basic of music as in....Reading notes
For 1 part of the project I thought I would have notes display and have an arrow running across the notes.
Then I would have a keyboard and a tempo running in the background.

What I plan on doing is have a keyboard made of buttons and for each button would be the sound of a note.
I think I will worry about the whole arrow thing later...

So, if this can be done I would appreciate if someone should be the code ( with comments if you don't mind ) as to how to play a sound under the button_click event

Thanks in advanced!
User is offlineProfile CardPM
+Quote Post

tomtech999
RE: Sound On Click Event
5 Dec, 2007 - 02:04 AM
Post #2

New D.I.C Head
*

Joined: 1 Dec, 2007
Posts: 9


My Contributions
Hi There!

The idea sounds interesting! The first thing I would do is to gather a collection of sound files for the various notes you wish to use (i'm not sure on the length of your keyboard).

I'm not sure if sound is implemented in .Net 3 but I'm sure that up to now there are no sound functions for c# apps. There is a way round this though as i used it in a media player I worked on a while ago. You can import the DLL "winmm.dll" and make a call "PlaySound()" to that dll to plya a sound. Full details found here

http://www.publicjoe.f9.co.uk/csharp/csharp17.html

Hope this helps. If you struggle with the DLL import method could you try using direct Sound (part of directX) or perhaps a third party sound playback library for .net. Best of luck!!

icon_up.gif

This post has been edited by tomtech999: 5 Dec, 2007 - 02:05 AM
User is offlineProfile CardPM
+Quote Post

corliss
RE: Sound On Click Event
6 Dec, 2007 - 10:32 PM
Post #3

D.I.C Head
Group Icon

Joined: 25 Oct, 2006
Posts: 119



Thanked: 1 times
Dream Kudos: 50
My Contributions
Your idea sounds really good.
Although there are many programs to power electronic keyboards there is noting if it is just sheet music.
Based off of your post I ass-u-me that you are going to use c# and there is a really nice piano projects on C#.
google it and Good learning.
Cheers,
Shawn Corliss

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:05AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month