在不使用外部API的情况下与c#中的音频交互? [英] Interact with audio in c# without the use of external APIs?

查看:82
本文介绍了在不使用外部API的情况下与c#中的音频交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在没有使用外部API(如BASS.net或NAudio)的情况下与音频进行交互,我知道WPF有一种方法可以天真地做到这一点但我还没有在winforms中看到任何东西,在挖了一下之后我能找到一些关于如何播放音频的例子,但没有关于如何实际分析和与之互动的例子。



我正在寻找任何例子或文章这可能会让我朝着正确的方向前进,我已经看了一下NAudio来源,但就我已经知道了。



提前谢谢,

Jordan

I would like to interact with audio without the use of external APIs such as BASS.net or NAudio, I know WPF has a way to do this naively but I haven't seen anything in winforms yet, after digging around a bit I was able to find a couple examples on how to play audio, but none on how to actually analyze and interact with it.

I am looking for any example or article that might push me in the right direction, I have looked a little into the NAudio source, but that's as far as I've gotten.

Thanks in advance,
Jordan

推荐答案

你没有解释交互是什么意思。所有这些第三方产品除了使用一个或另一个Microsoft API之外什么都不做,所以你也可以这样做。



第一个也是最老的API是winmm.dll(多媒体)系统),您可以通过P / Invoke使用:

http:// www.pinvoke.net/default.aspx/winmm/_ContentBaseDefinition.html [ ^ ]。



在MSDN中查找所有这些功能和类型,看看他们做了什么。



另一种选择是使用DirectSound: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416960%28v=vs.85%29.aspx [ ^ ]。br />


是的,您可以直接在C#中使用它: http:// msdn.microsoft.com/en-us/library/windows/desktop/bb318770%28v=vs.85%29.aspx [ ^ ]。



这是一个非常大的话题。所以,请不要问我如何使用它以及选择何种方法,直到你解释你想要实现的目标和更具体的问题。刚开始学习这些东西。



-SA
You did not explain what do you mean by "interact". All those 3rd-party products do nothing but using one or another Microsoft API, so you can do the same.

First and oldest API is the winmm.dll (Multimedia System), which you can use via P/Invoke:
http://www.pinvoke.net/default.aspx/winmm/_ContentBaseDefinition.html[^].

Find all of those functions and types in MSDN to see what they do.

Another option is to use DirectSound: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416960%28v=vs.85%29.aspx[^].

Yes, you can use it directly with C#: http://msdn.microsoft.com/en-us/library/windows/desktop/bb318770%28v=vs.85%29.aspx[^].

This is a really big topic. So, please don't ask me how to work with it and what approach to chose, not until you explain what exactly your are trying to achieve and as some more specific question. Just start learning this stuff.

—SA


这篇关于在不使用外部API的情况下与c#中的音频交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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