[CLAM] ASSERTION FAILED ERROR

RAVI GUPTA dce_ravigupta at yahoo.co.in
Mon Aug 11 03:23:13 PDT 2008


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_5AudioERNS_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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20080811/e0008291/attachment-0001.html>


More information about the clam-users mailing list