Click here to Skip to main content
15,889,838 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I wanna make sounds, how to do it in Windows Forms?
I don't wanna play sound, i wanna generate it from scratch.
How?
Posted
Comments
[no name] 24-Dec-14 10:04am    
Quote: "I wanna make sounds" do you like to make sound or to play sound?

Quote: "I don't wanna play sound, i wanna generate it from scratch". The sound or the player?

What???

Simply unclear....
Sergey Alexandrovich Kryukov 24-Dec-14 10:38am    
System.Windows.Forms is a graphical UI library, how can it be related to sounds? You really need to embrace Separation of Concerns and know what part of software does what.
—SA
Ziya1995 24-Dec-14 12:43pm    
I think it is possible to do in Windows Forms, but i don't know how, i need a simple example to study.
Sergey Alexandrovich Kryukov 24-Dec-14 13:02pm    
You can start study anything if only you find yourself capable to forget about Forms. And, in general, to be capable of abstraction. And to do that, you need understanding. So far, your study should be directed to getting understanding. So, you need to be capable of forgetting your goals as well, for certain period time. Seeing only your goals highly clouds your vision. You got a pretty good answer, Solution 1, why not using it?
—SA
Ziya1995 24-Dec-14 13:11pm    
I started using Solution 1, but why to forget Forms? I code using Windows Forms over 2 years learning it at the same time.

Let me know, what is wrong?

 
Share this answer
 
Comments
[no name] 24-Dec-14 10:14am    
+5. For me something like this is missing :-)
http://en.wikipedia.org/wiki/Harmony[^]
Sergey Alexandrovich Kryukov 24-Dec-14 10:38am    
5ed.
—SA
You will need some form of software library, or need to use MS' DirectSound, to create, and playback, sounds in C# WinForms.

NAudio is open-source, very powerful, on CodePlex, can be installed in Visual Studio using NuGet, and has a discussion Forum that is active: [^].

Or, you could use DirectX Sound, and use System.Media for playback; here's a well documented example (with source code) of how to creates, and play, a sine wave: [^].

Do search on CodeProject, because I am sure there are some DirectSound examples here.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900