From: Gerhard E. <ec...@ie...> - 2008-05-24 08:50:45
|
Dear Fooers, I noticed that the scanning for maxima and minima in sound file substrates is very slow in Foo. Such scanning is triggered by the kernel functions snd-maximum, snd-minimum, and snd-absolute-maximum (note: in contradition with the documentation, snd-absolute-maximum returns a pair containing the sample index of the maximum sample and the absolute maximum value). I also noticed that libsndfile supports peak amplitude handling (scanning and reading/writing peak information from/to the sound file header). It would thus be very convenient to use these libsndfile features. There is one drawback though: libsndfile doesn't keep the location of the peak in the file (as returned by snd-absolute-maximum and retained internally by Foo). Another positive aspect would be the possibility to enable the peak management in the library so that files are written with the peak information (according to the documentation, this concerns only floating point files - to be verified - would be nice to also have it with the other formats). Switching to libsndfile peak handling would habe the following consequences: (1) the index in snd-absolute-maximum would be wrong (set to 0) - we could also return to the documented behaviour, which only return the peak, but this will break code using snd-absolute-maximum (2) snd-minimum and snd-maximum wouldn't make much sense any more, snd-minimum should be removed and snd-maximum would resturn the absolute maximum for a pareticular channel I tested this change and it works fine. Now I am wondering what are your opinions of committing this change to the repository. The context in which this problem arose was my attempt to push foward the production of footils, the famous fs... scripts announced by Martin in this 2006 LAC-paper. Best regards, Gerhard |