如何重新采样 wav 文件
目前我正在录制具有以下规格的音频信号:
- Channels: 1
- SamplesPerSecond: 8000
- BitsPerSample: 16
如何将此 .wav 文件转换为以下规格(首选纯 c#):
- Channels: 1
- SamplesPerSecond: 22050
- BitsPerSample: 16
Currently I'm recording an audio signal with following specs:
- Channels: 1
- SamplesPerSecond: 8000
- BitsPerSample: 16
How can I convert this .wav-file to eg following specs (pure c# is preferred):
- Channels: 1
- SamplesPerSecond: 22050
- BitsPerSample: 16
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
用于重新采样音频的 Windows API(其中之一)是音频重新采样器 DSP。这个转换类非常简单地设置输入和输出类型,然后推送输入数据并拉出输出。
您可能需要额外处理的另一项任务是从文件读取并写入新文件(尽管您没有在原始描述中指定是否确实需要它)。
您可能还想使用第三方库,例如 NAudio。
另请参阅:
Windows API (one of) to resample audio is Audio Resampler DSP. This transform class is pretty straightforward to set up input and output types, then push input data and pull output.
Another task you would possible deal additionally with is reading from file and writing into a new file (you did not specify if it is actually needed in your original description though).
You might also want to use third party libraries like NAudio.
See also:
尝试 Naudio - 它是一个免费的开源 .NET 库,提供多种功能,包括重新采样 AFAIK 的能力。
按照请求的示例源进行重采样< /a>
try Naudio - it is a free + opensource .NET library offering several things including the ability to resample AFAIK.
As requested sample source for resampling
AS3 重采样函数。您可以轻松更改将此代码转换为 C#:
AS3 function for resampling. You can easy change to convert this code to C#:
尝试下面的代码 C# 将音频从 8khz 重新采样到 44.1/48khz
Try code below from C# resample audio from 8khz to 44.1/48khz