简体   繁体   English

使用C#NAudio将WAV转换为M4A

[英]Converting WAV to M4A using c# NAudio

I want to convert a WAV file into a M4A file. 我想将WAV文件转换为M4A文件。

I could not find any reference or any example of how to achieve that. 我找不到任何参考或如何实现该目标的任何示例。 Naudio should do the trick i assume, but i havent figured out how to do this yet. Naudio应该做我认为的技巧,但是我还没有弄清楚该怎么做。

I am writing a WebAPI2 project, and i need to return an m4a audio file to the user upon request. 我正在编写一个WebAPI2项目,我需要根据要求将m4a音频文件返回给用户。 Been using a PushStreamContent in order to provide the user with the file, but using an MP3 as the conversion target, lead to many difficulties with browser support and Seek/Pause/Stop support. 为了向用户提供文件而使用PushStreamContent ,但是使用MP3作为转换目标,则在浏览器支持和Seek / Pause / Stop支持方面带来了许多困难。

Thanks in advance, 提前致谢,
Nokky. Nokky。

M4A files simply contain AAC encoded audio. M4A文件仅包含AAC编码的音频。 Have a look at the Media Foundation Encoder demo in the NAudio WPF demo application to see an example of using MediaFoundationEncoder to create AAC files. 请查看NAudio WPF演示应用程序中的Media Foundation Encoder演示,以查看使用MediaFoundationEncoder创建AAC文件的示例。 It will let you encode as aac if you have an appropriate Media Foundation Codec on your machine (you should have with Win 7 and above, although note that it doesn't do low bitrates). 如果您的计算机上装有适当的Media Foundation编解码器,它将使您编码为aac(您应该使用Win 7及更高版本,尽管请注意它不会降低比特率)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM