简体   繁体   English

如何使用Naudio将WAV流转换为MP3?

[英]How to convert WAV stream to MP3 using Naudio?

I've seen a sample in Naudio documentation that it converts the MP3 stream to WAV stream. 我在Naudio文档中看到了一个示例,该示例将MP3流转换为WAV流。 My doubt is, does Naudio do it in reverse? 我的疑问是,Naudio是否会反向执行? That is, can it convert a WAV stream to MP3 stream? 也就是说,它可以将WAV流转换为MP3流吗? If yes, please explain how or help me with some references. 如果是,请说明如何使用或提供一些参考。

NAudio does not come with an MP3 encoder or decoder - it simply gives you access to the codecs that are already installed on your system. NAudio不带有MP3编码器或解码器-它只是使您可以访问系统上已经安装的编解码器。 Until Windows 8, Windows did not ship with an MP3 encoder, so your best option was to convert to WAV using something like LAME.exe . 在Windows 8之前,Windows尚未附带MP3编码器,因此最好的选择是使用LAME.exe之类的文件转换为WAV。 I explain how you can do this on the fly towards the end of this article . 本文结尾处,我将说明如何快速进行此操作

In Windows 8, there is an MP3 encoder, which you access with the new MediaFoundationEncoder.EncodeToMp3 function. 在Windows 8中,有一个MP3编码器,您可以使用新的MediaFoundationEncoder.EncodeToMp3函数进行访问。 This is currently pre-release for NAudio v1.7, but you can try it out by getting the latest build from nuget . 这是NAudio v1.7的当前预发布版本,但是您可以通过从nuget获取最新版本来进行尝试

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

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