SDIF

From FourMs

Revision as of 10:24, 4 January 2012 by Krisny (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Sound Description Interchange Format.

Contents

Compile the libraries

To work with SDIF files in Matlab, you need to compile and install EASDIF library. Note: you should log in as an administrator to do this.

To compile this you need the following:

Open Terminal and create a folder where you want things to happen.

First check out from the repository

$> cvs -z3 -d:pserver:anonymous@sdif.cvs.sourceforge.net:/cvsroot/sdif co -P EASDIF_SDIF

Create a directory for the build and move into the directory

$> mkdir BDIR
$> cd BDIR

Run cmake on the files

$> cmake -DEASDIF_BUILD_MEX:BOOL=on ../EASDIF_SDIF

Compile and install the files

$> make mex
$> make install

That's it.


Compiler settings

Depending on your Matlab distribution and OS version you might have to make certain changes. Most of this is documented in the README file, located in the EASDIF_SDIF directory.

The mex compiler script

If you are on OSX10.7, you may need to modify 'mexopts.sh' on your system. /Applications/MATLAB_R2010b.app/bin/mexopts.sh

Modify the 'maci' or 'maci64' section of 'mexopts.sh'.

CC=’gcc-4.2‘
SDKROOT=’/Developer/SDKs/MacOSX10.7.sdk’
MACOSX_DEPLOYMENT_TARGET=’10.7‘
CXX=g++-4.2
Arguments to the cmake command

If you have TeX installed, you might experience conflicts when calling the cmake command. An argument specifying the path to the mex compiler is necessary.

$> cmake -DMEX:STRING=/Applications/MATLAB_R2010b.app/bin/mex -DEASDIF_BUILD_MEX:BOOL=on ../EASDIF_SDIF

Furthermore, if you have 64 bit Matlab, it might be necessary to specify this as an argument

$> cmake -DMEX:STRING=/Applications/MATLAB_R2010b.app/bin/mex -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 
   -DEASDIF_BUILD_MEX:BOOL=on ../EASDIF_SDIF
Installing

Depending on your system settings, you might need to use the following command in order to make install:

$> sudo make install


Utilities

Some useful command line utilities for working on SDIF files:

  • querysdif
  • sdifextract
  • sdiftotext
  • sdiftoformat and sdiftofmt
  • texttosdif
  • formattosdif and fmttosdif

SDIF in Matlab

You have to include the following path to be able to use the SDIF-tools in Matlab:

/usr/local/lib/matlab

Then you have access to the following functions:

  • Fsdifloadfile
  • Fsdifopen
  • Fsdifclose
  • Fsdifread
  • Fsdifexist
  • Fsdifwrite
Personal tools