Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Speed control without changing pitch #167

Open
TommyAmberson opened this issue Nov 22, 2023 · 10 comments
Open

[Feature Request] Speed control without changing pitch #167

TommyAmberson opened this issue Nov 22, 2023 · 10 comments
Assignees

Comments

@TommyAmberson
Copy link

Currently we have a nice way to change the speed of the playback: #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.

@TommyAmberson
Copy link
Author

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.

@tramhao
Copy link
Owner

tramhao commented Nov 23, 2023

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.

@tramhao tramhao self-assigned this Nov 23, 2023
@tramhao
Copy link
Owner

tramhao commented Nov 25, 2023

https://lib.rs/crates/tdpsola found this and check if it's possible.

@ZioKli
Copy link

ZioKli commented Dec 21, 2023

This is my number 1 feature request for podcasts specifically. Are you open to PR's?

@tramhao
Copy link
Owner

tramhao commented Mar 18, 2024

Sure! PR's are welcomed!

@tramhao
Copy link
Owner

tramhao commented Mar 18, 2024

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.

@tramhao
Copy link
Owner

tramhao commented Mar 18, 2024

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.

@tramhao
Copy link
Owner

tramhao commented Mar 18, 2024

I modified the gstreamer backend to use scale tempo as well. Please try it with

termusic -b gstreamer

@hasezoey
Copy link
Contributor

Now that soundtouch has been added (via d2b3386 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.

@tramhao
Copy link
Owner

tramhao commented Apr 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants