QT和C ++的Changin mp3速度[QMediaPlayer][英] Changin mp3 speed in Qt and C++ [QMediaPlayer]

本文是小编为大家收集整理的关于QT和C ++的Changin mp3速度[QMediaPlayer]的处理方法,想解了QT和C ++的Changin mp3速度[QMediaPlayer]的问题怎么解决?QT和C ++的Changin mp3速度[QMediaPlayer]问题的解决办法?QT和C ++的Changin mp3速度[QMediaPlayer]问题的解决方案?那么可以参考本文帮助大家快速定位并解决问题,译文如有不准确的地方,大家可以切到English参考源文内容。

问题描述

我正在尝试开发一个小应用程序,您可以在其中加载mp3文件并以可变速度播放它! (我知道它已经存在:-))

我正在使用QT和C ++.我已经有了基本的播放器,但是我遇到了费率的问题,因为我想在不停止播放的情况下顺利更改速率(例如MixXx)!如果我更改值并在声音中造成差距,则QMediaPlayer总是会停止.我也不想改变球场!

我已经找到了一种叫做" Soundtouch"的东西,但是现在我完全无知处理它,如何处理我的MP3数据以及如何将其获取给玩家! " Soundtouch"库能够做我想做的事情,我从 主页.

  • 我必须如何导入MP3文件,因此我可以使用SoundTouch函数进行处理
  • 如何播放SoundTouch函数的输出? (也许Qmediaplayer可以完成这项工作?)
  • 这些事情如何现场生活?我猜我必须做某种流吗?因此,我可以在比赛过程中改变速度,并在没有空白的情况下继续比赛.我脑海中的图形性必须是数据和播放器之间的东西,所有数据都必须通过现场直播,而后面有一个小的缓冲区(20-50毫秒左右),以避免在处理未来数据时差距.

任何帮助! 我也向任何其他解决方案开放,然后" Soundtouch",只要我能留在QT/C ++!

(第二件事:我想查看波形概述以及移动部分(围绕歌曲的实际位置),因此我也可以使用有关如何获取波形数据的提示)

预先感谢!

推荐答案

截至目前(QT 5.5),这仅与QMediaPlayer无关.您需要执行以下操作:

此策略尽可能多地使用QT,并为您带来最佳的平台覆盖范围(尽管它不支持QaudioOutput,但您仍然会丢失Android)

本文地址:https://www.itbaoku.cn/post/2361314.html

问题描述

I'm trying to develop a little application in which you can load a mp3 file and play it in variable speeds! (I know it already exists :-) )

I'm using Qt and C++. I already have the basic player but I'm stuck with the rate thing, because I want to change the rate smoothly (like in Mixxx) without stopping the playback! The QMediaPlayer always stops if I change the value and creates a gap in the sound. Also I don't want the pitch to change!

I already found something called "SoundTouch" but now I'm completely clueless what to do with it, how to process my mp3 data and how to get it to the player! The "SoundTouch" Library is capable of doing what I want, i got that from the samples on the homepage.

  • How do I have to import the mp3 file, so I can process it with the SoundTouch functions
  • How can I play the output from the SoundTouch function? (Perhaps QMediaPlayer can do the job?)
  • How is that stuff done live? I have to do some kind of stream I guess? So I can change the speed during play and keep on playing without gaps. Graphicaly in my head it has to be something that sits between the data and the player, where all data has to go through live, with a small buffer (20-50 ms or so) behind to avoid gaps during processing future data.

Any help appreciated! I'm also open to any another solution then "SoundTouch" as long as I can stay with Qt/C++!

(Second thing: I want to view a waveform overview aswell as moving part of it (around actual position of the song), so I could also use hints on how to get the waveform data)

Thanks in advance!

推荐答案

As of now (Qt 5.5) this is impossible to do with QMediaPlayer only. You need to do the following:

This strategy uses Qt as much as possible, and brings you the best platform coverage (you still lose Android though as it does not support QAudioOutput)

查看更多