need help with libreplaygain + python and numpy |
![]() ![]() |
need help with libreplaygain + python and numpy |
Feb 7 2013, 20:21
Post
#1
|
|
|
Group: Members Posts: 3 Joined: 7-February 13 Member No.: 106481 |
Hi all !
I am trying to calculate the replay gain from Python, have tried over and over again, and failed miserably ... I figured that would be the best place to ask, but if it isn't please redirect me I am using the shared object "libreplaygain.so" and what happens is that whatever data I give to `gain_analyze_samples`, `gain_get_chapter` always returns 80.000 ... Here is the script I am using for testing : http://pastebin.com/4ngNuDZP EDIT : here is a simpler version of the same snippet using scipy to read the sound file : http://pastebin.com/C7AWiGC6 I've really tried everything, and I am a bit desperate now Thanks, Sébastien This post has been edited by sebpiq: Feb 7 2013, 21:13 |
|
|
|
Feb 7 2013, 21:14
Post
#2
|
|
![]() Group: Members Posts: 607 Joined: 16-January 09 Member No.: 65630 |
Not to me, but you can calculate RG just with scipy.
Additionally if you want to calculate filter coefficients, you can see example of Yulewalk in scikit talkbox, AR model function (or perhaps in statsmodels also), as it's not included in scipy. But coefficients can also be downloaded precomputed, for various sample rates. Original idea explained, with scripts (which or course slightly differs from your linked library): http://web.archive.org/web/20060713212205/...ulating_rg.html -------------------- Scripts (mainly foobar2000 related): http://goo.gl/yje3h
|
|
|
|
Feb 7 2013, 21:22
Post
#3
|
|
|
Group: Members Posts: 3 Joined: 7-February 13 Member No.: 106481 |
|
|
|
|
Feb 7 2013, 21:45
Post
#4
|
|
|
Group: Members Posts: 3 Joined: 7-February 13 Member No.: 106481 |
Ok ... I've got some improvement by using :
replaygain.gain_get_chapter.restype = ctypes.c_double before calling gain_get_chapter Now it returns different values (previously only 80.000), but it is still different than what the command line tool gives me (64dB vs. -3dB) |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 07:50 |