essentia icon indicating copy to clipboard operation
essentia copied to clipboard

Music Extractor results not reproducible

Open ashokkrishna94 opened this issue 4 years ago • 2 comments

Hi,

I am using MusicExtractor to generate various audio features but the results are not reproducible. Each time I execute the code I get a different output. Can someone help me understand why this is happening and how can I fix it?

Sample Code:

`

fname = "10258704_084.mp4.wav"

samplerate = 44100
audio = es.MonoLoader(filename=fname, sampleRate = samplerate)()
len(audio)

duration = len(audio)/samplerate

framesize = int(len(audio)/(duration)*0.025)  # 25ms
hopsize =  int(len(audio)/(duration)*0.010)  # 10ms

kwargs = {
'analysisSampleRate': samplerate,
'lowlevelFrameSize':framesize,
'lowlevelHopSize': hopsize,
'lowlevelZeroPadding': 2048 - framesize,
'loudnessFrameSize': framesize,
'loudnessHopSize': hopsize, 
'tonalFrameSize': framesize,
'tonalHopSize': hopsize
}

profile = "audio_config.yaml"

features, features_frames = es.MusicExtractor(profile = profile)(fname)

Output:

Run1: image

Run2: image

Thanks a lot!

ashokkrishna94 avatar Jul 01 '20 10:07 ashokkrishna94

Hi, have you checked the parameters lowlevelSilentFrames and tonalSilentFrames from MusicExtractor? By default, they add noise to the silent frames making it non-deterministic.

palonso avatar Aug 05 '20 08:08 palonso

One option to address this would be to use a fixed seed for random noise added in FrameCutter. We are using NoiseAdder and it allows to choose between a random seed or 0.

dbogdanov avatar Mar 25 '21 13:03 dbogdanov