Subtitle-Synchronizer / jlibrosa

Librosa equivalent Java library to process audio file adn extract features from it.
MIT License
89 stars 26 forks source link

Python Librosa API #5

Open pvoonna opened 3 years ago

pvoonna commented 3 years ago

Hi Vasanth,

Appreciate your initiative on this.

Small query : Is there equivalent API for below in Jlibrosa : librosa.get_duration librosa.db_to_amplitude librosa.core.istft librosa.magphase librosa.amplitude_to_db

Could you please answer.

pvoonna commented 3 years ago

Hi Vasanth,

Could you please share your thoughts on above query.

VVasanth commented 3 years ago

Hi Pvoonna - Apologies for responding late...somehow, I missed the notifications...Of the listed apis, jlibrosa currently support 'istft' generation and you can refer the latest version for this.

Rest of the api's are yet to be supported and will do them based on a need basis.

Thanks!

mymagicpower commented 2 years ago

For mag part of librosa.magphase:

  public static float[][] magnitude(Complex[][] stftComplexValues, float power) {
    int rows = stftComplexValues.length;
    int cols = stftComplexValues[0].length;
    float[][] mag = new float[rows][cols];

    for (int i = 0; i < rows; i++) {
      for (int j = 0; j < cols; j++) {
        mag[i][j] = (float) stftComplexValues[i][j].abs();
        mag[i][j] = (float) Math.pow(mag[i][j], power);
      }
    }

    return mag;
  }