在 C# 中从麦克风获取数据
我正在尝试从麦克风(或线路输入)录制音频数据,然后使用 C# 再次重播。
关于如何实现这一目标有什么建议吗?
I'm trying to record audio data from a microphone (or line-in), and then replay it again, using C#.
Any suggestions on how I can achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅控制台和多线程录制和播放
See Console and multithreaded recording and playback
NAudio 的实时链接。
https://github.com/naudio/NAudio
它以 NuGet 包的形式提供
有关输出设备的信息:
https://github.com/naudio/NAudio/blob/master/ Docs/OutputDeviceTypes.md
请记住常见问题解答中的以下性能:
“.NET 性能对于音频来说是否足够好?
虽然 .NET 无法与非托管语言竞争极低延迟的音频工作,但它的性能仍然优于许多人会期望在一台相当普通的 PC 上,您可以轻松地将多个 WAV 文件混合在一起,包括将它们传递给各种效果和编解码器,以大约 50 毫秒的延迟进行无故障播放。”
A live link of NAudio.
https://github.com/naudio/NAudio
It's available as a NuGet Package
Information about Output devices:
https://github.com/naudio/NAudio/blob/master/Docs/OutputDeviceTypes.md
Keep in mind for performance the following from the FAQ:
"Is .NET Performance Good Enough for Audio?
While .NET cannot compete with unmanaged languages for very low latency audio work, it still performs better than many people would expect. On a fairly modest PC, you can quite easily mix multiple WAV files together, including pass them through various effects and codecs, play back glitch free with a latency of around 50ms."