Re: SF2: bsefextract produces -inf



On 09.03.2017 17:33, Stefan Westerfeld wrote:
   Hi!

On Thu, Mar 09, 2017 at 04:01:00PM +0100, Tim Janik wrote:
with current wip/soundfont, I'm getting -inf on some audio tests.

Here's a test case for -inf results from bsefextract:

  http://testbit.eu/~timj/.tmp/sum-diff-test.wav

(temporary URL, will be removed at some point in the future)

tools/bsefextract sum-diff-test.wav --cut-zeros --channel 0 --avg-spectrum \
  --spectrum --avg-energy

gives:

avg_energy = -inf;

Not here (with your file):

$ ../tools/bsefextract --cut-zeros --channel 0 --avg-spectrum --spectrum --avg-energy sum-diff-test.wav
# this output was generated by bsefextract 0.10.1~wip from channel 0 in file sum-diff-test.wav
#
# --spectrum: generate 30ms sliced frequency spectrums
spectrum[0,0] = {
};
# --avg-spectrum: average frequency spectrum
avg_spectrum[0] = { };
# --avg-energy: average signal energy in dB
avg_energy = -5.61784072;

Ah, ok, that was the file from a different run then.

Please download again, I've updated the file with one that has just zeros.

Note that it will return -inf if the input sample is completely silent,
basically because average energy is measured in dB, and db(0) -> -inf.

Right, but that still leaves this warning unfixed:

../../tools/bsefextract sum-diff-test.wav --cut-zeros --channel 0 --avg-spectrum
--spectrum --avg-energy  > sum-diff-test.tmp
../../tools/bsefcompare ./sum-diff-test.ref sum-diff-test.tmp --threshold 99.99
sum-diff-test.tmp:9: error: unexpected identifier 'inf', expected number (float)

I.e. either you change the output to say something like "0" if there's no
energy,or bsefcompare should be prepared to handle +inf and -inf.

In any case I'd recommend finding a strategy
that reliably reduces the number of zeros produced before the actual output to
a minimum.

Yes, but that's a different topic/bug.


   Cu... Stefan


-- 
Yours sincerely,
Tim Janik

https://testbit.eu/timj/
Free software author.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]