Unsolved Does "playbackRate" property in Audio component work at all?
-
I use qt 5.12. When I try to set playbackRate property of Audio component, I dont' see any effect. I tried values from 0.1 to 2.0.
-
Works fine for me:
Qt 5.12.9
LinuxYou will need to provide your own sound. Mine is in a qrc file with "sound" prefix.
import QtQuick 2.12 import QtQuick.Window 2.12 import QtMultimedia 5.12 import QtQuick.Controls 2.12 Window { visible: true width: 640 height: 480 title: qsTr("Audio Test") Button { id: button text: "play sound" onClicked: { console.log(text) audio.play() } } Slider { id: slider anchors.top: button.bottom from: 0.1 to: 2.0 value: 1.0 width: 200 } Audio { id: audio playbackRate: slider.value source: "sound/haha.ogg" } }
-
@fcarney
What about mp3 sounds that are in playlist and loaded from arbitrary folder on the system and not from qrc file? -
@Amir-Afendin said in Does "playbackRate" property in Audio component work at all?:
mp3 sounds that are in playlist and loaded from arbitrary folder
I put in a fixed url: file:///home/fcarney/Music/melting.mp3
It played just fine. I could adjust the playback rate. However, for all sounds you cannot adjust rate while it is playing. It only seems to accept rate when it starts playing back. -
Audio { source: "file:///home/amir/Downloads/beautiful.mp3" playbackRate: 0.5 onStatusChanged: play() }
Mine isn't working. I tried different values on playbackRate but it plays normal speed. Xubuntu18.04 / Qt 5.12.7