使用 Qt 对音频声音进行回声效果
我正在 Qt(C++) 中开发一种音频处理实用程序。当我使用 qt 代码通过麦克风讲话时,我可以听到扬声器发出的音频。我需要对此音频输出应用回声效果。在我的代码中,我使用 16 位字节数组接收音频。 我如何将回声效果应用于此声音样本。
I am developing one audio processing utility in Qt(C++). I can hear audio from speaker when I speak through mike using my qt code. I need to apply echo effect to this audio output. In my code I am receiving audio using a 16 bit byte array.
How I can apply echo effect to this sound sample.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为产生回声的最简单方法是几乎同时播放两次声音,两次之间有轻微的延迟。您还可以使第二个实例的体积稍微小于第一个实例。
您可以通过将样本流与其自身混合在一起(带有偏移量)然后播放结果,或者可能通过创建两个 QAudioOutput 设备并在它们中播放声音来做到这一点(不过我还没有尝试过后者,所以我不确定它是否有效)
I think the simplest way to make an echo is to play the sound twice, near-simultaneously, with a slight delay between the two instances. You might also make the volume of the second instance a bit less than the first instance.
You can do this by either mixing the sample stream together with itself (with an offset) and then playing the result, or possibly by creating two QAudioOutput devices and playing the sound in both of them (I haven't tried the latter though, so I don't know for sure if it would work)