如何在C#Windows窗体中生成声波? [英] How to generate sound waves in C# Windows Forms?

查看:215
本文介绍了如何在C#Windows窗体中生成声波?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想发声,怎么在Windows窗体中做?

我不想播放声音,我想从头开始生成它。

如何? div class =h2_lin>解决方案

参考:声音的基础:如何让音乐完全没有任何结果 [ ^ ]


你需要某种形式的软件库,或需要使用MS'DirectSound,在C#WinForms中创建和播放声音。



NAudio是开源的,非常强大,在CodePlex上,可以使用NuGet在Visual Studio中安装,并且有一个活动的讨论论坛:[ ^ ]。



或者,您可以使用DirectX Sound,并使用System.Media回放;这里有一个很好的文档示例(包含源代码),介绍如何创建和播放正弦波:[ ^ ]。



搜索CodeProject,因为我确信这里有一些DirectSound示例。


I wanna make sounds, how to do it in Windows Forms?
I don't wanna play sound, i wanna generate it from scratch.
How?

解决方案

Refer: Fundamentals of Sound: How to Make Music out of Nothing at All[^]


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.


这篇关于如何在C#Windows窗体中生成声波?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆