Xeiron / sndfile.rs

A safe rust wrapper of libsndfile
MIT License
10 stars 7 forks source link

Add MP3 support #5

Open richardwesthaver opened 2 years ago

richardwesthaver commented 2 years ago

Looks like libsndfile recently got mp3 support - https://github.com/libsndfile/libsndfile/issues/258

The release on homebrew doesn't have it last time I checked but you can verify it's working by installing from source.

Any chance of adding to the supported formats of this library in the near future? happy to help with/test the implementation.

sample output:

> sndfile-info ~/mpk/tracks/mp3/luke_vibert-yamahorns.mp3

========================================
File : /Users/ellis/mpk/tracks/mp3/luke_vibert-yamahorns.mp3
Length : 7880842
Found 'ID3' marker.
  ID3v2.4 header length :   2185
----------------------------------------
MPEG-1/2 Audio
----------------------------------------
  MPEG version   : MPEG 1.0
  layer          : 3
  rate           : 44100
  mode           : joint stereo
  mode ext       : 0
  framesize      : 1044
  crc            : 0
  copyright flag : 0
  private flag   : 0
  original flag  : 1
  emphasis       : 0
  bitrate mode   : constant
  bitrate        : 320 kbps
ID3v1 Tags
  Title       : yamahorns
  Artist      : luke vibert
  Album       : voix des reason
  Year        : 2007
  Comment     :
ID3v2 Tags
  TIT2        : yamahorns
  TPE1        : luke vibert
  TRCK        : 673/999
  TALB        : voix des reason
  TDRC        : 2007
  COMM        : (ID3v1 Comment)[engCOMM] flac 1.1.2

----------------------------------------
Sample Rate : 44100
Frames      : 8682114
Channels    : 2
Format      : 0x00230082
Sections    : 1
Seekable    : TRUE
Duration    : 00:03:16.873
Signal Max  : 33052.7 (0.08 dB)
tuxzz commented 2 years ago

Yay! They finally added MP3 support! Thank you for the notice. I will check more details once I have free time.

hmijail commented 2 years ago

Also volunteering to help with whatever. In fact, if it's going to take long, maybe I can try to do it myself.

tuxzz commented 2 years ago

Also volunteering to help with whatever. In fact, if it's going to take long, maybe I can try to do it myself.

Thank you for your interest in this project.

I'm sorry but in fact I have no much free time since a long time ago. It would be great if you could contribute to this project. Make a PR once it's finished and I will take a review on it.