Tech Tip's : Do's and dont's


December 2014

Opensmile Toolkit Quick Setup

open Speech and Music Interpretation by Large Space Extraction (openSMILE )  It is written purely in C++, has a fast, efficient, and flexible architecture

The latest stable release of openSMILE can be found at

Official Opensmile download link : –

Download the latest binary for Opensmile.

Support is available for Linux, Windows and Mac Os users.

Data input: openSMILE can read data from the following file formats:
• RIFF-WAVE (PCM) (for MP3, MP4, OGG, etc. a converter needs to be used)
• Comma Separated Value (CSV)
• HTK parameter files
• WEKA’s ARFF format.
• Video streams via openCV.

Unix Installation

Use the following script that is in dashes  to do a complete installation and below is the description of what the script is doing.

Script begins here.


echo “Everything will be done in this directory.”
echo $result

tar -zxvf openSMILE-2.1.0.tar.gz
sudo apt-get install build-essential libtool

echo “run this in the directory where you want to install portaudio.”
sudo apt-get install libasound-dev
tar -zvxf pa_stable_v19_20140130.tgz
cd portaudio
./configure && make
sudo make install

#back to openSmile

cd ..

cd openSMILE-2.1.0

./SMILExtract -h
cd ..

unzip -d voicebox

Script is over here [Copy paste in a .sh file the above portion and run it as bash .sh]

Manual Installation

Detailed explanation begins here….

tar -zxvf openSMILE-2.x.x.tar.gz

This creates a folder called openSMILE-2.x.x. Change to this directory by typing:
cd openSMILE-2.x.x

Rather than using standalone script for installation it is my personal advice to install with PortAudio so that the user can have capability of recording and playing the audio files.

Build with PortAudio

Download Portaudio from and install it using the Readme file from the unzipped tar folder.
Else use synaptic package manager to install portaudio by just searching in the package manager

Assuming PortAudio is installed correctly type

then type in bash

If fails then you probably have a dependency missing
For my system the dependency missing was libtool

Thus to install that type out
sudo apt-get install build-essential libtool

Then rerun bash to get the autoconfiguration done.

If it fails again
[On linux, the Opensmile SEMAINE component can be built from the SEMAINE-2.0-source package. All third-party software required to run the system is open source software, and is already included in the install package.

To build the system, a number of standard build tools need to be installed: gcc, automake, etc. To install them on an Ubuntu Linux system, type:

sudo apt-get install automake autoconf gcc g++ libasound2-dev make libtool patch libx11-dev  


The portion in square brackets may be needed for some systems. Though there is no harm in installing it again

Now after installing the above packages type again :

Later type ./configure to configure with portaudio

sh [-p install-prefix-path]
-p install-prefix-path is optional
to install the opensmile toolkit.

If you have installed openSMILE to a non-default path, you must set your library
path to include the newly installed libopensmile before running the SMILExtract binary (replace
/directory/prefix/to/install/to by the path you have passed to the –prefix option of
the configure script):
export LD LIBRARY PATH=/directory/prefix/to/install/to/lib
You will also need to add the path to the binary to your current PATH variable:
export PATH=”$PATH:/directory/prefix/to/install/to/lib”

Compiling on Linux with openCV and portaudio support.

sudo apt-get install libopencv*

The installation path of OpenCV (PATH TO OPENCV) in this case will be /usr/

If you get an error message that some of the libopencv*.so libraries are not found when you
run SMILExtract, type this command in the shell before you run SMILExtract:
export LD LIBRARY PATH=”/usr/local/lib

The built executable is called SMILExtract and is found in the inst/bin sub-directory. Please note,that in this case, it is a wrapper script, which sets up the library path and calls the actual binary SMILExtract.bin. Thus, you can also use this method if you have a locally installed (different) PortAudio. Just be sure to always run openSMILE through the wrapper script, and not run the binary directly (this will use the system wide, possibly incompatible, PortAudio library).

Test of Installation
Now, that you have either successfully downloaded and installed the binary version of openSMILE or have compiled the source code yourself, you are ready to test the program and extract your first features. To check if you can run SMILExtract, type:

./SMILExtract -h

If you see the usage information and version number of openSMILE, then everything is set up correctly.


Process text faster with Awk and Sed

Sed comes from “stream editor”,
The name Awk is derived from the surnames of its three authors – Alfred Aho, Peter Weinberger and Brian Kernighan – and is a handy pattern matching programming language that is Turing-complete.

Sed can handle and quickly process arbitrarily long inputs – its processing capabilities are similar to the capabilities of the ed editor

1) Install Awk and Sed

sudo apt-cache search nawk/gawk
If found then go for installation of the same

sudo apt-get install gawk

else check for which gawk 

2)  Using Sed

The following Sed code globally replaces a given string with another in a text file:

$ sed ‘s/string1/string2/g’ textfile
If you want to save the original file contents to a new file and the changed version to the 
original file, you should use the -i option as 

$ sed -i.bak ‘s/three/3/g’ text 
The previous command replaces every occurrence of the word “three” with 
“3”, saves the output to the file “text” and keeps the original content
inside “text.bak”. If you want to perform a case insensitive global
search and replace, you should use the following command: 

$ sed -i.bak ‘s/three/3/gi’ text

3) Using Awk

By default, Awk splits input lines into fields based on whitespace (spaces and tabs). You can change the default behaviour by using the -F command line option and providing another character.

To print “Hello World” using awk go to the command line and type out the following: –

echo “” | awk ‘{print “Hello World!”}’ 

The above is a more useful way to print hello world using command line.

4) A Sed example

Sed allows you to make changes in multiple lines. The following example changes the path of the Perl binary from “/usr/local/bin/perl” to “/usr/bin/perl” in multiple files:

$ sed ‘s/\/usr\/local\/bin\/perl/\/usr\/bin\/perl/g’ *.pl
Note that you have to use the escape character “\” in order to use the “/” character as a normal character. Always remember that once a line is read by Sed, the previous line is gone forever.

5) An Awk example










Blog at

Up ↑