psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
240 stars 45 forks source link

Feature Request: Algorithms for pitch shifting/time stretching such as PSOLA or WSOLA #18

Closed BucketofJava closed 1 year ago

BucketofJava commented 2 years ago

First I would like to say this is an amazing and well-written library. I was wondering if it would be possible for a feature for time stretching or pitch shifting such as PSOLA or WSOLA to be added, as I think such a feature would be a good addition to the features this library has. Again, thank you for making such a great library

psambit9791 commented 2 years ago

I think this would be a good addition but we do not have anything on the roadmap. I will add these as new functionalities to be included as the library matures.

Thanks for your support.

psambit9791 commented 2 years ago

Starting development on an implementation of PSOLA that is due to be released in v1.1.0.

BucketofJava commented 2 years ago

Any update on release of this feature?

psambit9791 commented 2 years ago

Development ongoing for various features in speech processing. Release has been moved to v2.0.0 which will be the next release. Timescales will be released soon.

psambit9791 commented 1 year ago

This is a fairly complex piece of functionality and warrants a different project to develop. I am aiming to provide the components required for PSOLA/WSOLA through JDSP and then separately develop another project for OLA methods.

DonHorrell commented 1 year ago

This would be a great feature to add. I would also like to see a "streaming" version, so that it could be incorporated into a real-time audio stream - there are some examples of streaming processors in "Digital Audio Processing" by Craig A Lindley. A "nice to have" would be the ability to change the parameters while it is streaming i.e. being able to change the tempo factor/pitch factor in real time.

DonHorrell commented 1 year ago

Hi all. I have done a very rough port of the TDStretch class from SoundTouch into Java. I have not done much in the way of testing yet. Subjectively it does a good job on stereo MP3 files (using the JLayer library to read in the data). I also used Audacity to convert an MP3 to mono, and that works too. Timestretch factors below 0.4 cause an exception & the results are poor with a timestretch > 2.

I could do a bit of tidying & drop a zip of the code here, if it would help. As SoundTouch is covered by the LGPL V2.1 (or later), can this translated version be released under the MIT license?