简体   繁体   English

播放视频时如何更改音频格式?

[英]How to change the audio pich when playing back video?

I'm developing a video player for playing karaoke videos. 我正在开发一个用于播放卡拉OK视频的视频播放器。 One useful feature would be to change the key of a song while playing back. 一个有用的功能是在播放时更改歌曲的键。 So how could I modify the audio stream of a video while playing back in a QT application? 那么,如何在QT应用程序中播放时修改视频的音频流? There seemed to be hardly any information about this. 似乎几乎没有任何信息。

Audio signal processing is quite complex and I expect fairly mathematical. 音频信号处理非常复杂,我希望算术也不错。 The question has previously been asked here on StackOverflow , so if you're going to want to do the actual processing yourself, reading that thread and following the links will be a good place to start. 之前已经在StackOverflow上提出这个问题,因此,如果您想自己进行实际处理,那么阅读该线程并关注链接将是一个不错的起点。

If you're new to audio signal processing, you may be better searching for a library that does what you want, to include in your project. 如果您不熟悉音频信号处理,则最好搜索一个可以满足您需求的库,以将其包含在项目中。

There are many ways to achieve a Pitch Shift effect that you are looking for. 您可以通过多种方法来实现音高转换效果。 I know You are working with c++ for your project but i think this tutorial for a Max MSP patch will help you understand some of the basics of one Pitch Shift algorithm. 我知道您正在为您的项目使用c ++,但是我认为教程针对Max MSP补丁程序将帮助您了解一种变音算法的一些基础知识。 I don't know how familiar you are with digital audio theory but a few things you will need to look into are FFT , and Generating sine waves in code. 我不知道您对数字音频理论有多熟悉,但是您需要研究的一些内容是FFT和在代码中生成正弦波。 I personally still do not have a mathematical grasp on FFT works but if you know what it does it can help you understand how to deconsruct audio signals. 我个人对FFT的工作仍然没有数学上的了解,但是如果您知道FFT的作用,则可以帮助您了解如何解构音频信号。

Good Luck, Happy Coding 祝你好运,编码愉快

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM