如何在我的asp.net项目中添加lame库 [英] How to add lame library in my asp.net project
本文介绍了如何在我的asp.net项目中添加lame库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,我试图将wav文件转换为mp3文件。
因此我正在尝试添加蹩脚的dll文件的引用,但很快我尝试添加引用获取提示在组件中找不到类型库。那么如何在我的项目中添加库,或者是否有任何c#转换的lame库可用。
非常感谢。
Hello there i trying to convert wav files to mp3 files.
Therefore i am trying add reference of the lame dll file but very time i try to add the reference get the prompt No type libraries were found in the component.so how can i add the libraries in my project or are there any c# converted libraries of lame available.
Huge Thanks.
推荐答案
首先,阅读与您使用LAME相关的可能的专利侵权说明: http://en.wikipedia.org/wiki/LAME [ ^ ]。
因为它是用C语言编写的,所以你可以通过P / Invoke使用.NET中的代码:
http://en.wikipedia.org/wiki/PInvoke [ ^ ],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp [ ^ ]。
但是,我宁愿建议使用ffMpeg或libavcodec: http://en.wikipedia .org / wiki / Ffmpeg [ ^ ],
http://ffmpeg.org/ [ ^ ],
http:// en.wikipedia.org/wiki/Libavcodec [ ^ ],
http://libav.org/ [ ^ ]。
在这两种情况下,您都可以获得免费的开源实用程序几乎所有东西,包括从帧图片中组装你的视频。
现在,如何在.NET应用程序中以编程方式使用它?首先,您可以使用System.Diagnostics.Process.Start
运行它来使用可用的实用程序:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx [ ^ ]。
如果这还不够好,你可以自己将库包装在.NET程序集中,或找到合适的包装器。请参阅:
http://www.ffmpeg-csharp.com/ [ ^ ],
http://sourceforge.net/projects/sharpffmpeg/ [ ^ ],
http://vbffmpegwrapper.codeplex.com/ [ ^ ]。
毕竟,尝试找一些: http://bit.ly/VpboUJ [ ^ ]。
如果你想工作在你自己的包装但不知道如何,问一个问题,我会给你基本的想法(使用P / Invoke或C ++ / CLI混合模式项目)。
祝你好运,
-SA
First of all, read the note of possible patent infringing related to your use of LAME: http://en.wikipedia.org/wiki/LAME[^].
As it is written in C, you can use the code in .NET via P/Invoke:
http://en.wikipedia.org/wiki/PInvoke[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].
However, I would rather advise to use ffMpeg or libavcodec: http://en.wikipedia.org/wiki/Ffmpeg[^],
http://ffmpeg.org/[^],
http://en.wikipedia.org/wiki/Libavcodec[^],
http://libav.org/[^].
In both cases, you can get free open-source utilities which can make nearly everything, including assembling your video from frame pictures.
Now, how to use it programmatically in a .NET application? First, you can use the available utility by running it usingSystem.Diagnostics.Process.Start
:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx[^].
If this is not good enough, you can wrap the library in a .NET assembly by yourself or find appropriate wrapper. Please see:
http://www.ffmpeg-csharp.com/[^],
http://sourceforge.net/projects/sharpffmpeg/[^],
http://vbffmpegwrapper.codeplex.com/[^].
After all, try to find some more: http://bit.ly/VpboUJ[^].
If you wish to work at such wrapper by yourself but don't know how, ask a question, I'll give you the basic ideas (using P/Invoke or C++/CLI "mixed-mode" project).
Good luck,
—SA
这篇关于如何在我的asp.net项目中添加lame库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文