使用 C# 进行声音合成

发布于 2024-12-23 21:40:42 字数 83 浏览 11 评论 0原文

C# 是否有可能生成声音?我的意思不仅仅是发出蜂鸣声或打开并播放波形文件。我的意思是使用不同类型的波(正弦波、锯齿波等)及其选项(频率、幅度等)构建信号

Is there some possibility to generate sounds in C#? I mean not just beep or open and play wave-file. I mean build the signal using different kinds of waves (sin, saw, etc.) and their options (frequencies, amplitudes, etc.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

成熟的代价 2024-12-30 21:40:43

查看 GitHub 上的 NAudio

NAudio 是一个开源 .NET 音频和 MIDI 库,包含数十个有用的音频相关类,旨在加速 .NET 中音频相关实用程序的开发。它自 2001 年以来一直在开发,现已发展到包含多种功能。虽然该库的某些部分相对较新且不完整,但更成熟的功能已经过广泛的测试,可以快速用于向现有 .NET 应用程序添加音频功能。

您可以直接使用该库,也可以查看其源代码以了解它在低级别上的工作原理。

Check out NAudio on GitHub.

NAudio is an open source .NET audio and MIDI library, containing dozens of useful audio related classes intended to speed development of audio related utilities in .NET. It has been in development since 2001 and has grown to include a wide variety of features. While some parts of the library are relatively new and incomplete, the more mature features have undergone extensive testing and can be quickly used to add audio capabilities to an existing .NET application.

You could either use the library directly, or check out its source code to find out how it works at a low level.

叹沉浮 2024-12-30 21:40:43

这是我写的关于 的博客文章如何使用 NAudio 创建正弦波。显然,这只是制作完整合成器的第一步,因为您还需要创建其他波形、ADSR 包络、滤波器等,但它至少应该让您入门。

Here's a blog post I wrote about how to create a sine wave with NAudio. Obviously that's just a first step to making a full blown synthesizer as you will also want to create other waveforms, ADSR envelopes, filters etc, but it should at least get you started.

帥小哥 2024-12-30 21:40:43

我强烈建议您查看 VST .Net 平台。这将允许您在 .Net 中创建自己的 VST。如果您想要进行合成,您可能会发现创建 VST 并将其托管在您选择的 DAW 中比创建一次性应用程序更容易。这是因为如果您创建 VST,则不必担心处理音频接口驱动程序或 ASIO 等。
https://vstnet.codeplex.com/

此外,您还需要一组用户控件界面。标准的 Windows 窗体或 WPF 控件可能可以达到目的,但合成器爱好者通常喜欢看到漂亮的皮肤控件。我最近发布了这些控件,它们的行为类似于普通的 WPF 控件,但专为综合而设计:
https://bitbucket.org/MelbourneDeveloper/vst-controls-.net/

I highly recommend that you look at the platform VST .Net. This would allow you to create your own VSTs in .Net. If you want to do synthesis, you will probably find that is easier to create a VST and host it in your DAW of choice rather than create a once off app. This is because if you create a VST, you don't have to worry about dealing with the audio interface drivers or ASIO etc.
https://vstnet.codeplex.com/

Also, you'll also need a set of controls for the user interface. The standard Windows Forms, or WPF controls might do the trick, but synth enthusiasts usually like to see nicely skinned controls. I recently released these controls which behave like normal WPF controls, but are designed for synthesis:
https://bitbucket.org/MelbourneDeveloper/vst-controls-.net/

独夜无伴 2024-12-30 21:40:43

您可以使用FLooping。它是一个用 F# 编写的库,为音频合成提供常见的构建块,如振荡器、包络、滤波器等。目前处于实验状态。

披露:我是 FLooping 的开发者。

You can use FLooping. It is a library written in F#, providing common building blocks for audio synthesis like oscillators, envelopes, filters, etc. It is currently in an experimental state.

Disclosure: I am the developer of FLooping.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文