gpodder-sailfish
gpodder-sailfish copied to clipboard
Feature request: playback speed control with pitch compensation
Use case: depending on podcast contents and situation the speed of playback should be adjustable at all times.
In my personal opinion a podcast player without speed control is unusable.
See if http://doc.qt.io/qt-5/qml-qtmultimedia-mediaplayer.html#playbackRate-prop can be used and/or adapted.
Another speed modyfying library is at https://github.com/waywardgeek/sonic
playbackRate
in Qt (at least on Sailfish OS) changes pitch, so that's a no-go.
Funnily, HTML5 audio does pitch-preserving playback rate changes, and it works in the Sailfish browser. So that'd be one dirty hack to get it running on SFOS before someone comes around and wraps sonic into a QML plugin for use.
still a thing? Or not important?
still a thing? Or not important?
It is THE missing feature, that prevents me from using gpodder again.
Do you have a player on SFOS that does it with pitch compensation? I have in the past played with this but as thp said there was no pitch adjustment....
Do you have a player on SFOS that does it with pitch compensation? I have in the past played with this but as thp said there was no pitch adjustment....
Not directly, I was/am using AntennaPod (Android).
This is a must have feature also on other platforms supported by gpodder, but I assume mobile phone OSes are a priority here.
Have you tried this recently?
https://doc.qt.io/qt-5/qml-qtmultimedia-mediaplayer.html#playbackRate-prop
I don't remember if it corrects for pitch or not, and if it works properly for all media types, but if it does, that would be rather easy to expose in the UI (that already existed back then, but didn't fully work AFAIR).
Keeper-of-the-Keys [email protected] schrieb am Do., 5. Dez. 2019, 09:04:
Do you have a player on SFOS that does it with pitch control? I have in the past played with this but as thp said there was no pitch adjustment....
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gpodder/gpodder-sailfish/issues/29?email_source=notifications&email_token=AABBASISFF3X6EPVIJ77G23QXCYYHA5CNFSM4A5NBKVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF73I6Y#issuecomment-562017403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABBASNWKOGGLLPCFOFICFLQXCYYHANCNFSM4A5NBKVA .
Unfortunately I do not have any possibility to test it now.
My Jolla (The First One) after a year or so was powering down on any shock (like putting it on a table), so I switched to Android supported hardware. It is a real pity there is no non Sony hardware running SFOS :(
I created a slider that allowed adjusting the playbackRate about a year ago I just never pushed it because it doesn't do pitch adjustment.
@Keeper-of-the-Keys Could you add it, with needing to be activated in the settings or so and mark it as experimental maybe? I'd love to have it and wouldn't mind pitching too much, but unterstand that it's not a good default as of yet.
I'll try to find the code for it (this was still done editing files on my phone, I did back it up though), however as far as I recall it was very much alpha quality with playback stopping if you changed the rate and other weird behavior.
(Either way it will not be in the 4.11 release that we'll be doing any day now - sorry)
No worries. If you want any testing beforehand, I can try this as well.
@Keeper-of-the-Keys you found the code? I tried it with player.plabackRate=2.0 but it works only after play/pause and yes, it has pitch
Got now a version with pitch, but a button which toggles playbackspeed on tap. My patches:
diff --git a/qml/PlayerPage.qml b/qml/PlayerPage.qml
index d7d5adc..562d4f5 100644
--- a/qml/PlayerPage.qml
+++ b/qml/PlayerPage.qml
@@ -236,6 +236,15 @@ Page {
onFired: player.seekAndSync(player.position + 1000 * 60)
}
}
+
+ IconMenuItem {
+ text: qsTr("rate")
+ icon.source: 'image://theme/icon-m-play'
+ GPodderAutoFire {
+ running: parent.down
+ onFired: player.toggleSpeedup()
+ }
+ }
}
SectionHeader {
And in gpodder-ui-qml:
diff --git a/common/GPodderPlayback.qml b/common/GPodderPlayback.qml
index f39da99..3799bba 100644
--- a/common/GPodderPlayback.qml
+++ b/common/GPodderPlayback.qml
@@ -230,6 +230,16 @@ MediaPlayer {
onTriggered: player.flushToDisk();
}
+ function toggleSpeedup(){
+ if(player.playbackRate >1){
+ player.playbackRate = 1;
+ }else{
+ player.playbackRate = 1.25;
+ }
+ sendPositionToCore(lastPosition);
+ seek(lastPosition);
+ }
+
property var seekAfterPlayTimer: Timer {
interval: 100
repeat: true
when sailfishos finally uses qt 5.12 this can be fixed by including scaletempo in the gstreamer pipeline via the source
@Keeper-of-the-Keys you found the code? I tried it with player.plabackRate=2.0 but it works only after play/pause and yes, it has pitch
I haven't checked on my phone but it's not on my computer :/ But it used the same idea as you change the playbackRate
SFOS 3.4 looks like it's still on Qt 5.6 so no luck there (which is an even bigger bummer for the redirect issue)
Only fix that comes to my mind is writing our own player where we have the gstreamer pipeline under control... Or use a webview
Since SFOS 4.2 supports pitch correction I'd love to change playback speed in gPodder, however I haven't found a UI control to set the desired playback speed. Wouldn't it be rather simple to add a slider to the settings page?
We added it to podqast, its a bit tricky to get the playbackspeed updated, but feel free to reuse our code from here
Wow, I missed that in the release notes, I'll try to add this asap. @thigg thanks!
ty, I was glad abaranson picked my research on this up
@thigg thanks for everything! I'll be merging this and doing a release soon!
There are two types of plugins supported in QMediaPlayer One is DirectShow and other is WindowsMediaFoundation Qmediaplayer support the old plugin bydefault (directshow) which changes the pitch when you change the speed. You just have to switch from directshow to windowsmediafoundation In PyQt5 Just write this line of code before importing anything import os os.environ['QT_MULTIMEDIA_PREFERRED_PLUGINS'] = "windowsmediafoundation"
@mostuselessboy This is running on Linux (SailfisOS), so the backend is gstreamer unless I'm very much mistaken.