timbral_models icon indicating copy to clipboard operation
timbral_models copied to clipboard

[line 253:] segment returns a empty list when a sound file has too short attack time.

Open albincorreya opened this issue 8 years ago • 3 comments

Got the following error when I tried to compute timbral_hardness for the following sound. I suspect it's because the sound has too short attack time.

http://freesound.org/people/ShawnyBoy/sounds/165394/

ERROR : line 253, in timbral_hardness segment /= float(max(segment)) ValueError: max() arg is an empty sequence

To confirm I tried to print the values of segment and found out one of the segments is an empty list for this sound. I tried to add a condition to ignore the block if there is an empty sequence but couldn't solve it and not quite sure how to optimise the code for this use case

albincorreya avatar May 19 '17 13:05 albincorreya

Thanks for pointing this out, I'll patch this when I do the next update in a few weeks.

AndyP103 avatar May 24 '17 10:05 AndyP103

I've recently updated the hardness model, fixing a few of the bugs that may have been causing this behaviour.

AndyP103 avatar Mar 16 '18 14:03 AndyP103

Nice ! By the way @AndyP103 , I had used this model to create a demo prototype. You can find at https://github.com/albincorreya/PerceptualSoundBrowser in case interested.

albincorreya avatar Mar 20 '18 11:03 albincorreya