[Clam-devel] adding frames to a segment

Pau Arumi parumi at iua.upf.edu
Wed Jun 20 09:27:56 PDT 2007


Hi Greg and Xavier,

my idea was to not use segment, but creating a collection of
analysis frames using the streaming Do().

Greg, I'll contact you set a meeting and discuss the details.
Btw, have you tried to write proper port publishers for your
processing?

Cheers!
pau


En/na Xavier Amatriain ha escrit:
> Hi Greg,
> 
> The Do(segment) overload in SpectralAnalysis expects to have a usable 
> frame wherever the currentFrameIndex in the segment is pointing.
> All frame initialization or addition to the segment should be done 
> outside. Look at the code in the SpectralAnalysis::Do method:
> 
> http://clam.iua.upf.edu/doc/CLAM-devel-doxygen/SpectralAnalysis_8cxx-source.html#l00159 
> 
> 
> On the other hand (and pretty inconsistently, I must say) the 
> SMSAnalysis class does handle this issue internally so it *does* manage the
> addition of new frames into an empty Segment. Although I am not keen on 
> this happening inside of a Do operation, it is clearly a good place
> to look to see what exactly you will need to do in your code:
> 
> http://clam.iua.upf.edu/doc/CLAM-devel-doxygen/SMSAnalysis_8cxx-source.html#l00140 
> 
> 
> Hope it helps!
> 
> Greg Kellum wrote:
>> Hi all,
>>
>> I've been trying to get CLAM to load an audio file, analyze it, and 
>> write the results to an SDIF file.  So far I have CLAM reading audio 
>> into a segment, but when I give this segment to the class 
>> SpectralAnalysis everything goes down with a null pointer exception 
>> because the segment doesn't yet have any frames.  I'm not sure what I 
>> need to do here.  I could create a new Frame object and add it to the 
>> Segment's frame list, but there must be a class that is responsible 
>> for chopping the audio data into frames.  So, I really shouldn't need 
>> to do this.  The question is what class does this?  After one loads 
>> audio data into a Segment what does one have to do to create the list 
>> of frames before passing the Segment on to the analysis routine?
>>
>> I've included an example file below that illustrates what I'm talking 
>> about.  The null pointer exception comes at the line
>>          while (aSpectralAnalysis.Do( aSegment )) {}
>> And it's thrown inside the SpectralAnalysis object when that object 
>> tries to access a Frame object that doesn't exist.
>>
>> Best,
>> Greg




More information about the clam-devel mailing list