windows 如何实现变声器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/959660/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:35:57  来源:igfitidea点击:

How to implement a voice changer?

windowsdirectx

提问by

I want to write a app which change the microphone input voice and make it like robot or some funny man's voice.It must support send changed voice to all application like IM Software or Game Client. Which technology should I pick up? Windows WaveForm Api? DirectX? audio driver?

我想写一个改变麦克风输入声音的应用程序,使它像机器人或一些有趣的人的声音。它必须支持将改变的声音发送到所有应用程序,如 IM 软件或游戏客户端。我应该选择哪种技术?Windows WaveForm API?直连?音频驱动?

Thank you very much!

非常感谢!

回答by Noldorin

There's an MSDN Coding4Fun articlethat explains how to create a voice changer that operates over Skype, in C# (.NET). The full source code is also hosted as a project on CodePlex. In addition, it should be fairly easy do something else with the audio (as opposed to streaming it via Skype), since the project is based around the NAudioframework, which contains a good level of abstraction. Anyway, it is a reasonably complete (and stable) example - definitely worth checking out in my opinion.

有一篇 MSDN Coding4Fun 文章解释了如何使用 C# (.NET) 创建一个通过 Skype 运行的语音转换器。完整的源代码也作为项目托管在CodePlex 上。此外,使用音频做其他事情应该很容易(而不是通过 Skype 流式传输),因为该项目基于NAudio框架,其中包含一个很好的抽象级别。无论如何,这是一个相当完整(且稳定)的示例 - 在我看来绝对值得一试。

If you want/need to use C++ or some other language for development, then this project should at least give you some ideas about how to go about it. Still, if you can use .NET, then you're in luck I think.

如果你想/需要使用 C++ 或其他一些语言进行开发,那么这个项目至少应该给你一些关于如何去做的想法。不过,如果您可以使用 .NET,那么我认为您很幸运。

回答by ziggystar

Robot voice is often done with a ring modulatoreffect, mixing the voice with a sine wave - this is easier. Or use a vocodereffect, modulating the voice onto some other waveform, like rectangle - might be a bit more tricky. Go read up how the effects work, get a program with which you can check out how they sound (Audacity works for the ring modulator, finding and using a vocoder may be a bit harder). Then read how it's done or get a library which will do the processing for you.

机器人语音通常使用环形调制器效果完成,将语音与正弦波混合 - 这更容易。或者使用声码器效果,将声音调制到其他波形上,比如矩形——可能会有点棘手。去阅读效果如何工作,获得一个程序,你可以用它来检查它们的声音(Audacity 适用于环形调制器,找到和使用声码器可能有点困难)。然后阅读它是如何完成的或获取一个可以为您进行处理的库。

回答by the_drow

You are looking to support VSTi or DXi plugins.
There are tons that also act as vocoders, even for free.
You just need to write the host application. Take a look here:)

您希望支持 VSTi 或 DXi 插件。
有很多也可以作为声码器,甚至是免费的。
您只需要编写主机应用程序。看看这里:)

回答by billmcc

Now that's a neat idea, especially for a mobile app.

现在这是一个好主意,尤其是对于移动应用程序。

I'd probably start off-line by using a .wav file as input to get the effects working the way I wanted. You can use any high level language for this, but you probably want something that will map reasonably well into C/C++.

我可能会通过使用 .wav 文件作为输入来离线开始,以使效果按我想要的方式工作。为此,您可以使用任何高级语言,但您可能想要一些能够很好地映射到 C/C++ 的东西。

In terms of a production version, I'd go native and do this in C or C++. You want something fast for real time audio processing & I like to avoid dependencies on things like .net for distribution. (Not that I have anything against .net, it's great for servers and distribution within a company but I'm not so keen on having it as a dependency for shrink wrap software.)

就生产版本而言,我会使用本机版本并使用 C 或 C++ 来执行此操作。你想要一些快速的实时音频处理,我喜欢避免依赖 .net 之类的东西进行分发。(并不是说我反对 .net,它非常适合公司内的服务器和分发,但我不太热衷于将其作为收缩包装软件的依赖项。)

Windows DirectShow would be a tempting option - you could do some interesting effects with multi-media as well if you had the voice morpher implemented as a direct show filter.

Windows DirectShow 将是一个诱人的选择 - 如果您将语音变形器实现为直接显示过滤器,您也可以使用多媒体制作一些有趣的效果。

回答by chris166

What you're looking for is a vocoder. I don't know if any of the technologies listed above has a vocoder effect, but the best chance would be with DirectX.

您正在寻找的是vocoder。我不知道上面列出的任何技术是否具有声码器效果,但最好的机会是使用 DirectX。

回答by vijay

Try this sample app .I think its useful to you.Link

试试这个示例应用程序。我认为它对你有用。关联