<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><span style="font-style: italic;">Hi,<br><br>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.<br><br>#include <CLAM/MonoAudioFileReader.hxx></span><br style="font-style: italic;"><span style="font-style: italic;">#include <CLAM/SpectralAnalysis.hxx></span><br style="font-style: italic;"><span style="font-style: italic;">#include <CLAM/MelFilterBank.hxx></span><br style="font-style: italic;"><span style="font-style: italic;">#include <CLAM/CepstralTransform.hxx></span><br style="font-style: italic;"><span style="font-style: italic;">#include <CLAM/Audio.hxx></span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style:
 italic;">#include<CLAM/XMLStorage.hxx></span><br style="font-style: italic;"><span style="font-style: italic;"></span><span style="font-style: italic;"></span><br style="font-style: italic;"><span style="font-style: italic;">int main(int argc, char ** argv)</span><br style="font-style: italic;"><span style="font-style: italic;">{</span><br style="font-style: italic;"><span style="font-style: italic;">    if (argc!=2) return error ("needs a filename.");</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::MonoAudioFileReaderConfig mReaderCfg;</span><br style="font-style: italic;"><span style="font-style: italic;">    mReaderCfg.SetSourceFile(argv[1]);</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::MonoAudioFileReader mReader (mReaderCfg);</span><br
 style="font-style: italic;"><span style="font-style: italic;">    </span><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::SpectralAnalysis spectralAnalysis;</span><br style="font-style: italic;"><span style="font-style: italic;">    //specAnalysis.start();</span><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::MelFilterBank melFilterBank;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::CepstralTransform cepstralTransform;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::Audio audio;</span><br style="font-style: italic;"><span style="font-style: italic;">    //mReader.start();</span><br style="font-style: italic;"><span style="font-style: italic;">  
  mReader.Do(audio);</span><br style="font-style: italic;"><span style="font-style: italic;">    //mReader.stop();</span><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::XMLStorage::Dump(audio,"Audio","audio.xml");</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::Spectrum spectrum;</span><br style="font-style: italic;"><span style="font-style: italic;">    //spectralAnalysis.start();</span><br style="font-style: italic;"><span style="font-style: italic;">    spectralAnalysis.Do(audio, spectrum);</span><br style="font-style: italic;"><span style="font-style: italic;">    //spectralAnalysis.stop();</span><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::XMLStorage::Dump(spectrum, "Spectrum","spectrum.xml");</span><br
 style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    /*CLAM::MelSpectrum melSpectrum;</span><br style="font-style: italic;"><span style="font-style: italic;">    //melFilterBank.start();</span><br style="font-style: italic;"><span style="font-style: italic;">    melFilterBank.Do(spectrum, melSpectrum);</span><br style="font-style: italic;"><span style="font-style: italic;">    //melFilterBank.stop();</span><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::XMLStorage::Dump(melSpectrum, "MelSpectrum","melSpectrum.xml");</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::MelCepstrum melCepstrum;</span><br style="font-style: italic;"><span style="font-style: italic;">    //cepstralTransform.start();</span><br
 style="font-style: italic;"><span style="font-style: italic;">    cepstralTransform.Do(melSpectrum, melCepstrum);</span><br style="font-style: italic;"><span style="font-style: italic;">    //cepstralTransform.stop();</span><br style="font-style: italic;"><span style="font-style: italic;">    CLAM::XMLStorage::Dump(melCepstrum,"MFCC","MFCC.xml");*/</span><br style="font-style: italic;"><span style="font-style: italic;">}</span><br><br><span style="font-style: italic;">When I run this program I got errors:<br><br>Adding TypePlugin N4CLAM5AudioE shown as CLAM::Audio (Buffer) with color lightcyan</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin f shown as CLAM::Audio (Stream) with color lightblue</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin St6vectorIfSaIfEE shown as Floats vector with color silver</span><br style="font-style:
 italic;"><span style="font-style: italic;">Adding TypePlugin St6vectorISt4pairIffESaIS1_EE shown as Float pairs vector with color thistle</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin N4CLAM7LPModelE shown as CLAM::LPModel with color orange</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin N4CLAM8SpectrumE shown as CLAM::Spectrum with color yellowgreen</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin N4CLAM17SpectralPeakArrayE shown as CLAM::SpectralPeakArray with color lightcoral</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin N4CLAM11FundamentalE shown as CLAM::Fundamental with color sandybrown</span><br style="font-style: italic;"><span style="font-style: italic;">Adding TypePlugin N4CLAM11MelCepstrumE shown as CLAM::MelCepstrum with color palegreen</span><br style="font-style:
 italic;"><span style="font-style: italic;">Adding TypePlugin N4CLAM11MelSpectrumE shown as CLAM::MelSpectrum with color seagreen</span><br style="font-style: italic;"><span style="font-style: italic;">##########################################################</span><br style="font-style: italic;"><span style="font-style: italic;">################### ASSERTION FAILED #####################</span><br style="font-style: italic;"><span style="font-style: italic;">##########################################################</span><br style="font-style: italic;"><span style="font-style: italic;">At file scons/libs/core/src/Audio.cxx line 136</span><br style="font-style: italic;"><span style="font-style: italic;">Audio::GetAudioChunk: Incorrect index boundaries for audio chunk</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> Backtrace:</span><br style="font-style: italic;"><br style="font-style:
 italic;"><span style="font-style: italic;">[0] /usr/lib/libclam_core.so.1(_ZN4CLAM13DumpBacktraceERSo+0x29) [0xb7f24b19]</span><br style="font-style: italic;"><span style="font-style: italic;">[1] /usr/lib/libclam_core.so.1 [0xb7f24d0b]</span><br style="font-style: italic;"><span style="font-style: italic;">[2] /usr/lib/libclam_core.so.1(_ZN4CLAM18ErrAssertionFailedC1EPKcS2_i+0x6d) [0xb7f2496d]</span><br style="font-style: italic;"><span style="font-style: italic;">[3] /usr/lib/libclam_core.so.1(_ZNK4CLAM5Audio13GetAudioChunkEiiRS0_b+0x61) [0xb7f1a911]</span><br style="font-style: italic;"><span style="font-style: italic;">[4] /usr/lib/libclam_processing.so.1(_ZN4CLAM16SpectralAnalysis2DoERKNS_5AudioERNS_8SpectrumE+0xcf) [0xb7b155bf]</span><br style="font-style: italic;"><span style="font-style: italic;">[5] ./MFCCs [0x805608a]</span><br style="font-style: italic;"><span style="font-style: italic;">[6] /lib/libc.so.6(__libc_start_main+0xdc)
 [0xb774cf9c]</span><br style="font-style: italic;"><span style="font-style: italic;">[7] ./MFCCs(_ZNK4CLAM7BPFTmplIffE7StoreOnERNS_7StorageE+0xb9) [0x8055c91]</span><br style="font-style: italic;"><span style="font-style: italic;">terminate called after throwing an instance of 'CLAM::ErrAssertionFailed'</span><br style="font-style: italic;"><span style="font-style: italic;">  what():  Audio::GetAudioChunk: Incorrect index boundaries for audio chunk</span><br style="font-style: italic;"><span style="font-style: italic;">Aborted<br><br>Can anybody tell me what is the problem? I think the problem is in MonoAudioFileReader<br>but I don't know how to sovle it.<br><br>Thanks in advanced.<br></span></td></tr></table><br>


      <!--1--><hr size=1></hr> Connect with friends all over the world. <a href="http://in.rd.yahoo.com/tagline_messenger_1/*http://in.messenger.yahoo.com/?wm=n/"> Get Yahoo! India Messenger.</a>