[CLAM] ASSERTION FAILED ERROR

David García Garzón dgarcia at iua.upf.edu
Mon Aug 11 03:49:55 PDT 2008


The problem is that you should start all the processings before doing any Do.

The common procedure is:
1. Create and configure all processings
2. Start all processings
3. A loop calling Do
4. Stop all processings

The loop calling Do can be while the reader Do returns true. You will iterate 
for each frame. I am not sure about how the window size and hop is defined if 
you use the Do with parameters. Check the examples.


On Dilluns 11 Agost 2008, RAVI GUPTA wrote:
> Hi,
>
> I had written a code for computing the MFCCs from an audio file. Currently
> in the code below I am using the default configuration of every processing
> element so I am not configuring them.
>
> #include <CLAM/MonoAudioFileReader.hxx>
> #include <CLAM/SpectralAnalysis.hxx>
> #include <CLAM/MelFilterBank.hxx>
> #include <CLAM/CepstralTransform.hxx>
> #include <CLAM/Audio.hxx>
>
> #include<CLAM/XMLStorage.hxx>
>
> int main(int argc, char ** argv)
> {
>     if (argc!=2) return error ("needs a filename.");
>
>     CLAM::MonoAudioFileReaderConfig mReaderCfg;
>     mReaderCfg.SetSourceFile(argv[1]);
>
>     CLAM::MonoAudioFileReader mReader (mReaderCfg);
>     
>     CLAM::SpectralAnalysis spectralAnalysis;
>     //specAnalysis.start();
>     CLAM::MelFilterBank melFilterBank;
>
>     CLAM::CepstralTransform cepstralTransform;
>
>     CLAM::Audio audio;
>     //mReader.start();
>     mReader.Do(audio);
>     //mReader.stop();
>     CLAM::XMLStorage::Dump(audio,"Audio","audio.xml");
>
>     CLAM::Spectrum spectrum;
>     //spectralAnalysis.start();
>     spectralAnalysis.Do(audio, spectrum);
>     //spectralAnalysis.stop();
>     CLAM::XMLStorage::Dump(spectrum, "Spectrum","spectrum.xml");
>
>     /*CLAM::MelSpectrum melSpectrum;
>     //melFilterBank.start();
>     melFilterBank.Do(spectrum, melSpectrum);
>     //melFilterBank.stop();
>     CLAM::XMLStorage::Dump(melSpectrum, "MelSpectrum","melSpectrum.xml");
>
>     CLAM::MelCepstrum melCepstrum;
>     //cepstralTransform.start();
>     cepstralTransform.Do(melSpectrum, melCepstrum);
>     //cepstralTransform.stop();
>     CLAM::XMLStorage::Dump(melCepstrum,"MFCC","MFCC.xml");*/
> }
>
> When I run this program I got errors:
>
> Adding TypePlugin N4CLAM5AudioE shown as CLAM::Audio (Buffer) with color
> lightcyan Adding TypePlugin f shown as CLAM::Audio (Stream) with color
> lightblue Adding TypePlugin St6vectorIfSaIfEE shown as Floats vector with
> color silver Adding TypePlugin St6vectorISt4pairIffESaIS1_EE shown as Float
> pairs vector with color thistle Adding TypePlugin N4CLAM7LPModelE shown as
> CLAM::LPModel with color orange Adding TypePlugin N4CLAM8SpectrumE shown as
> CLAM::Spectrum with color yellowgreen Adding TypePlugin
> N4CLAM17SpectralPeakArrayE shown as CLAM::SpectralPeakArray with color
> lightcoral Adding TypePlugin N4CLAM11FundamentalE shown as
> CLAM::Fundamental with color sandybrown Adding TypePlugin
> N4CLAM11MelCepstrumE shown as CLAM::MelCepstrum with color palegreen Adding
> TypePlugin N4CLAM11MelSpectrumE shown as CLAM::MelSpectrum with color
> seagreen ##########################################################
> ################### ASSERTION FAILED #####################
> ##########################################################
> At file scons/libs/core/src/Audio.cxx line 136
> Audio::GetAudioChunk: Incorrect index boundaries for audio chunk
>
>  Backtrace:
>
> [0] /usr/lib/libclam_core.so.1(_ZN4CLAM13DumpBacktraceERSo+0x29)
> [0xb7f24b19] [1] /usr/lib/libclam_core.so.1 [0xb7f24d0b]
> [2] /usr/lib/libclam_core.so.1(_ZN4CLAM18ErrAssertionFailedC1EPKcS2_i+0x6d)
> [0xb7f2496d] [3]
> /usr/lib/libclam_core.so.1(_ZNK4CLAM5Audio13GetAudioChunkEiiRS0_b+0x61)
> [0xb7f1a911] [4]
> /usr/lib/libclam_processing.so.1(_ZN4CLAM16SpectralAnalysis2DoERKNS_5AudioE
>RNS_8SpectrumE+0xcf) [0xb7b155bf] [5] ./MFCCs [0x805608a]
> [6] /lib/libc.so.6(__libc_start_main+0xdc) [0xb774cf9c]
> [7] ./MFCCs(_ZNK4CLAM7BPFTmplIffE7StoreOnERNS_7StorageE+0xb9) [0x8055c91]
> terminate called after throwing an instance of 'CLAM::ErrAssertionFailed'
>   what():  Audio::GetAudioChunk: Incorrect index boundaries for audio chunk
> Aborted
>
> Can anybody tell me what is the problem? I think the problem is in
> MonoAudioFileReader but I don't know how to sovle it.
>
> Thanks in advanced.
>
>
>
>       Did you know? You can CHAT without downloading messenger. Go to
> http://in.webmessenger.yahoo.com/



-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20080811/02368dac/attachment-0002.sig>


More information about the clam-users mailing list