.wma到mono,使用C#的PCM 8 KHz .wav格式 [英] .wma to mono, PCM 8 KHz .wav format using C#

查看:75
本文介绍了.wma到mono,使用C#的PCM 8 KHz .wav格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用C#将.wma转换为单声道,PCM 8 KHz .wav格式。哪个应该与Windows Server 2008 / XP和7特别兼容。



这有用吗?

I am trying to convert .wma to mono, PCM 8 KHz .wav format using C#. Which should be particularly compatible with Windows server 2008/ XP and 7.

Does this work?

推荐答案

我知道的最好的事情是ffmpeg或相关的libav。请参阅:

http://en.wikipedia.org/wiki/FFmpeg [< a href =http://en.wikipedia.org/wiki/FFmpegtarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/Libavcodec [ ^ ],

http:// ffmpeg。 org / [ ^ ],

http://libav.org/ [ ^ ]。



你可以看到它是如何工作的并在C#中实现它,但即使你想要它也会有大量的工作量实现所需的最小值。



一个简单的解决方案是:从源代码获取或构建可执行文件,然后通过 System.Diagnostics.Process.St art : http://msdn.microsoft.com/en -us / library / system.diagnostics.process.aspx [ ^ ]。



此外,您可以获取并构建库并使用P / Invoke链接它们。



如果您需要学习P / Invoke,请从这里开始:

http://en.wikipedia.org/wiki/P/Invoke [ ^ ],

http://msdn.microsoft.com/en-us/library/Aa712982 [ ^ ]。



此CodeProject也很有用: Essential P / Invoke [ ^ ]。



P / Invoke的一种替代方法是使用C ++ / CLI混合模式(托管+非托管)项目。此项目可以构建全局钩子所需的DLL,但它可以包含一些托管包装器CLI代码,因此,从.NET应用程序的角度来看,您可以将其用作常规.NET程序集,即引用它。请参阅:

http://en.wikipedia.org/wiki/C %2B%2B / CLI [ ^ ],

http://www.ecma-international .org / publications / standards / Ecma-372.htm [ ^ ],

http:/ /msdn.microsoft.com/en-us/library/xey702bw.aspx [ ^ ],

http:/ /msdn.microsoft.com/en-us/library/3bstk3k5 [ ^ ]。



如果你想要的话以编译形式重新分发图书馆,存在一个法律问题:由于专利问题或其他原因,它们不会在预先编制的表格上重新分发。



-SA
The best thing I know is ffmpeg or related libav. Please see:
http://en.wikipedia.org/wiki/FFmpeg[^],
http://en.wikipedia.org/wiki/Libavcodec[^],
http://ffmpeg.org/[^],
http://libav.org/[^].

You can see how it works and implement it in C#, but it would be huge amount of work, even if you want to implement the required minimum.

A trivial solution will be: to obtain or build executable from source code and then execute it as a child process via System.Diagnostics.Process.Start: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^].

Also, you can obtain and build the libraries and link them using P/Invoke.

If you need to learn P/Invoke, start from here:
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/en-us/library/Aa712982[^].

This CodeProject can also be useful: Essential P/Invoke[^].

One alternative to P/Invoke is to use C++/CLI mixed-mode (managed+unmanaged) project. This project could build a DLL required by the global hooks, but it can contain some managed wrapper CLI code, so, from the standpoint of your .NET application, you can use it as a regular .NET assembly, that is, reference it. Please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[^],
http://msdn.microsoft.com/en-us/library/3bstk3k5[^].

If you want to re-distribute the libraries in compiled form, there is a legal problem: due to patent issues or something, they are not re-distributed on pre-compiled form.

—SA


这篇关于.wma到mono,使用C#的PCM 8 KHz .wav格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆