1

I am extracting prosody features from an audio file while using Opensmile using Windows version of Opensmile. It runs successful and an output csv is generated. But when I open csv, it shows some rows that are not readable. I used this command to extract prosody feature:

SMILEXtract  -C \opensmile-3.0-win-x64\config\prosody\prosodyShs.conf -I audio_sample_01.wav -O prosody_sample1.csv

And the output of csv looks like this:

[output of above mentioned command for prosody deatures1

Even I tried to use the sample wave file given in Example audio folder given in opensmile directory and the output is same (not readable). Can someone help me in identifying where the problem is actually? and how can I fix it?

Judith Guzman
  • 415
  • 3
  • 11
Aizayousaf
  • 39
  • 15

2 Answers2

1

You need to enable the csvSink component in the configuration file to make it work. The file config\prosody\prosodyShs.conf that you are using does not have this component defined and always writes binary output.

You can verify that it is the standart binary output in this way: omit the -O parameter from your command so it becomesSMILEXtract -C \opensmile-3.0-win-x64\config\prosody\prosodyShs.conf -I audio_sample_01.wav and execute it. You will get a output.htk file which is exactly the same as the prosody_sample1.csv.

How output csv? You can take a look at the example configuration in opensmile-3.0-win-x64\config\demo\demo1_energy.conf where a csvSink component is defined.

You can find more information in the official documentation:

Marius
  • 1,529
  • 6
  • 21
1

This is how I solved the issue. First I added the csvSink component to the list of the component instances. instance[csvSink].type = cCsvSink

Next I added the configuration parameters for this instance.

[csvSink:cCsvSink]
reader.dmLevel = energy
filename = \cm[outputfile(O){output.csv}:file name of the output CSV 
file]
delimChar = ;
append = 0
timestamp = 1
number = 1
printHeader = 1
\{../shared/standard_data_output_lldonly.conf.inc}`

Now if you run this file it will throw you errors because reader.dmLevel = energy is dependent on waveframes. So the final changes would be:

[energy:cEnergy]
reader.dmLevel = waveframes
writer.dmLevel = energy

[int:cIntensity]
reader.dmLevel = waveframes

[framer:cFramer]
reader.dmLevel=wave
writer.dmLevel=waveframes

Further reference on how to configure opensmile configuration files can be found here

Moody
  • 31
  • 3
  • Hello @Moody I want to extract features using opensmile tool, for example I use this command: `SMILExtract -C config/demo/demo1_energy.conf -I example-audio/opensmile.wav -O opensmile.energy.csv` the problem here is, in the input you can enter one audio file, but in my case I have a folder contain 1000 audio files, is there a possibility to extract features of all audio files in the folder and generate one (.csv) file for all audio files ? – Adil chakhtouna Oct 25 '21 at 18:53
  • I would do it in python like this: `import os` `for each in allFiles: name = each.replace('Desktop/all_files','').replace('.wav','') os.system("SMILExtract -C config/demo/demo1_energy.conf -I " + each + " -O folder_to_save/file_"+name+".csv")` – Moody Oct 26 '21 at 19:22