termusic
termusic copied to clipboard
[Feature Request] Speed control without changing pitch
Currently we have a nice way to change the speed of the playback: https://github.com/tramhao/termusic/issues/47
However this doesn't work for a lot of use cases since it also changes the pitch. Some reasons I've encountered to change the playback speed without changing the pitch:
- Practicing playing along to a song. You can start slow and change the speed as you get comfortable with the song.
- Listening to a lecture or audiobook. (although it is quite entertaining to listen to it at 2x speed with the pitch change)
I know some people like to change the speed of songs along with the pitch so I think it would be nice if there was a setting that could toggle between changing the pitch along with the speed and keeping the pitch the same.
I am currently using audacity to change the speed but I sometimes need to switch to VLC (https://www.reddit.com/r/Ubuntu/comments/uvjfjs/a_simple_audio_player_with_easy_to_adjust/) when I need to change the speed on the fly.
This is also what I want to do. Recently I changed to a new job and have less time coding. I'll try to catch up.
https://lib.rs/crates/tdpsola found this and check if it's possible.
This is my number 1 feature request for podcasts specifically. Are you open to PR's?
Sure! PR's are welcomed!
Today I found several implementation for this. For mpv backend, there should be scaletempo by default. And we could add -af=rubberband
for better results. For gstreamer backend, scaletempo and rubberband exists by plugin. I could try to use them and see the difference. For rusty backend, right now I haven't found any solution for it.
I checked that mpv backend is using -af=scaletempo2 by default, so the pitch is preserved automatically. You can try
termusic -b mpv
The result is pretty good to me.
I modified the gstreamer backend to use scale tempo as well. Please try it with
termusic -b gstreamer
Now that soundtouch
has been added (via d2b3386a6bd655fe2428134b2a2e6981d2e8bbff and before), the rusty
backend now can change the speed without pitch (to my understanding).
This will be included in the next version with is either 0.10.0 or 0.9.1.
Downsides are that now rusty
is not purely rust anymore.
Downsides are that now
rusty
is not purely rust anymore.
This is driving me crazy. I'm trying to port a simple algorithm sonic.rs from c code, but is not successful. Working with the bindings to sonic.c, and the result is not as good as libsoundtouch. The best result is mpv backend scaletempo2 algorithm. To translate this algorithm into rust, will be a bigger task.